TFlexCelImport.OpenFile( 'c:\test.xls' )

Hi to all,

j have a little big problem with the new version of flexcell on delhi XE 2.

Just download and instal latest version of flexcell (both, visual 3.81 and 6.6.22)

After downloaded and installed reopened delphi xe 2, reload the project, rebuild it and ....

big problem on TFlexCelImport.OpenFile( 'c:\test.xls' ).

On my form j have TFlexcellGrid linked to a TFlexCelImport linked to a TXLSAdapter.

when j try to load the Excel file 'c:\test.xls' with TFlexCelImport.OpenFile( 'c:\test.xls' ) j get this error

'Project myproject.exe raised exception class Exception with message 'the file '''' is invalid.'

This error occured in XLXAdapter when, in

procedure TXLSFile.OpenFileAndOrSearch(const FileName: TFileName; const Search: boolean);

when execute lines

fs := TFileStream.Create(SearchFileName, fmOpenRead or fmShareDenyNone);


in Openstream call

DataStream := TOle2File.Create(aStream);

and in ole2imp on line

Create(aStream, false);

j got the error.

The error occured with both file .xls or .xlsx

Please have any idea to resolve this problem in short time??

thanks for your appreciate help



Is this XlsAdapter or XlsxAdapter ?

Also is this happening with any xls file or only with test.xls?

Hi Adrian,

the grid was linked to a XlsAdapter, now j removed the XlsAdapter and defined a XlsxAdapter.

In on create event the grid is linked to a new XlsxAdapter and after that the grid is able to display both xls/xlsx file(s).

Thank's so much for your help.