Databasedeki kayıtları excele aktardıktan sonra Excel.Quit ile exceli kapatıyorum, ancak bilgisayarı kapatırken kitap1 kaydetmek ister misiniz uyarısı alıyorum Excel.Quit yerine ne kullana bilirim...
var
book: Variant;
excel, sheet: Variant;
UpdateLinks : Integer; //0=No updates; 1=Updates external but not remote references; 2=Updates remote but not external references; 3=Updates both remote and external references
ReadOnly : Boolean; //True=ReandOnly; False=Read/Write
Format : Integer; //1=Tabs; 2=Commas; 3=Spaces; 4=Semicolons; 5=Nothing; 6=Custom character, see the delimiter argument.
begin
excel := CreateOleObject('Excel.application');
excel.DisplayAlerts := false;
UpdateLinks := 0; //0=No updates; 1=Updates external but not remote references; 2=Updates remote but not external references; 3=Updates both remote and external references
ReadOnly := True; //True=ReandOnly; False=Read/Write
book := excel.WorkBooks.Open[OpenDialog1.FileName, UpdateLinks, ReadOnly];
sheet := book.worksheets[1];
....
...
if not VarIsEmpty(excel) then
begin
excel.WorkBooks.Close;
excel.quit;
excel := Unassigned;
sheet := Unassigned;
end;
end
Ehil olmayanlara sabretmek ehil olanları parlatır.
Akıllı birisinden gelen cefa, bilgisizlerin vefasından iyidir.
Bilgiye ulaştı mı ayak, kanat olur
Biz insanı kıyafetiyle ağırlar bilgisiyle uğurlarız. Mevlana