Link to home
Start Free TrialLog in
Avatar of DanielManchester
DanielManchester

asked on

Automation problem with Delphi 2010 and Excel 2013

I have been using TExcelApplication component in Delphi to create a new Excel document and save it to file using automation.  It has been working fine until I tried it will Excel 2013 and when I call

TExcelApplication.Save(sFile);  I get the following error OLE Error 800A03EC

Here is my code:

try
ExcelApplication.Connect;

except on E: Exception do
   begin
    E.Message := 'Excel unavailable.';
     raise;
   end;
end;
lcid := GetUserDefaultLCID;

  ExcelApplication.Visible [0] := true;
  ExcelApplication.Caption := 'Chronicle Document';

    excelapplication.workbooks.Add(EmptyParam, 0);
    ExcelApplication.DisplayAlerts[lcid] := False;
    ExcelApplication.activeworkbook.SaveAs(sFile, EmptyParam, EmptyParam,
              EmptyParam, EmptyParam, EmptyParam,
              xlNoChange, EmptyParam, EmptyParam,
              EmptyParam, EmptyParam, lcid);

I add some data to the work book and then call TExcelApplication.Save(sFile);

Thanks for you help

Daniel
ASKER CERTIFIED SOLUTION
Avatar of Sinisa Vuk
Sinisa Vuk
Flag of Croatia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial