Delphi 7 and Excel 2007 Open File Error

Posted by Traci on Stack Overflow See other posts from Stack Overflow or by Traci
Published on 2010-06-17T06:47:33Z Indexed on 2010/06/17 6:53 UTC
Read the original article Hit count: 909

Filed under:
|
|

I am having difficulty opening a EXCEL 2007 in Delphi 7 It works for Office 2003 and below but the wonderful people at microsoft have sent an update or something and the delphi app fell over just earlier this month.

  oE := GetActiveOleObject('Excel.Application');
  oE.Workbooks.Open(Filename:=sFilename, UpdateLinks:=false, ReadOnly:=true); //Error

I get the following error:

'c:\Temp\Book1.xls' could not be found. Check the spelling of the file name, and verify that the file location is correct.'#$A#$A'If you are trying to open the file from your list of most recently used files, make sure that the file has not been renamed, moved, or deleted'

Yet if I run the same command in VBA there is no problem.

© Stack Overflow or respective owner

Related posts about delphi

Related posts about excel-2007