With following Code i Save my AdvStringGrid (grdAbz) to a Excel File.
procedure TForm1.btnExcelSaveClick(Sender: TObject);
Var
s: String;
begin
s := ProgPath + 'Listen\SHWAbz.xlsx';
if FileExists(s) then DeleteFile(s);
grdAbz.SaveToXLS(s,True); // <-- Here OLE-Error
//TTMSFNCUtils.OpenFile(s);
ShellExecute(0, 'open', PChar(s), nil, nil, SW_SHOWNORMAL);
end;
This Error Message appear when i Call grdAbz.SaveToXLS(s,True);
Im Projekt .... ist eine Exception der Klasse EOLeSysError mit der Meldung "Vorgang nicht verfügbar" aufgetreten.
This Error only appears in DebugMode not in Runtime Mode.
I am using Windows 10 and Office 2019.
My Customer got the Problem, that the last opened ExcelSheet was show but with the File-Name of my Sheet (SHWAbz.xlsx) in the Header and it was saved with this name, whe i save the file. It seems that my List has read the lastopend ExcelWorkbook with many Sheets in it.
Is it normal that a OLE-Error was thrown from Windows when i am in Debug Mode ?