Kod: Tümünü seç
procedure TForm6.Button1Click(Sender: TObject);
begin
try
excel:=CreateOleObject('Excel.Application');
except
ShowMessage('excel başlatılamıyor');
exit;
end;
excel.workbooks.Open('C:\Program Files\3M\DENETIM\Doc\kalip.xls',,ReadOnly:=False);
excel.Cells[9,6].value:=Form1.DBEdit1.Field.Value;
excel.Cells[10,6].value:=Form1.DBEdit80.Field.Value;
excel.Cells[10,8].value:=Form1.DBEdit81.Field.Value;
excel.Cells[11,6].value:=Form1.DBEdit3.Field.Value;
excel.Cells[12,6].value:=Form1.DBEdit5.Field.Value;
excel.Cells[13,6].value:=Form1.DBEdit4.Field.Value;
excel.Cells[13,8].value:=Form1.DBComboBox3.Field.Value;
excel.Cells[14,6].value:=ComboBox1.Text;
excel.Cells[14,8].value:=ComboBox2.Text;
excel.Cells[15,6].value:=Form1.DBEdit2.Field.Value;
excel.Cells[16,6].value:=DBEdit1.Field.Value;
excel.Cells[17,6].value:=Form1.DBEdit77.Field.Value;
excel.Cells[20,4].value:=ComboBox1.Text;
excel.Cells[20,6].value:=ComboBox2.Text;
excel.Cells[33,3].value:=DateToStr(DateTimePicker1.Date);
excel.Cells[45,1].value:=Form1.DBLookupComboBox1.Field.Value;
excel.Cells[45,6].value:=Form1.DBLookupComboBox11.Field.Value;
excel.Cells[45,9].value:=Form1.DBEdit77.Field.Value;
excel.Visible:=True;
end;
procedure TForm6.FormClose(Sender: TObject; var Action: TCloseAction);
begin
if not VarIsEmpty(excel) then
excel.quit;
excel:=Unassigned;
end;