sergio-hcsoft/Delphi-SpreadSheets

Correctly loading XLS* Files

Closed this issue · 2 comments

Hi,

thank you very much for this tool. It helps us a lot while importing Excel files. I have found one issue if one wants to import XLSX or oder XML based Excel files. Since the extension is not equal to "xls" the object tries to load OpenOffice, which, in some cases is not installed on the machine.

You would have to change line 676 to:

IF (copy(UpperCase(ExtractFileExt(m_strFileName)),1,4) = '.XLS') THEN

cheers
Marco

This is fixed in the pending pull request (and my clone of the repository), by using a function to determine if a file is an excel file.

Hi Marcus, this was fixed time ago as adnsistemas commented, in the current version it uses this function:

function THojaCalc.IsExcelFileExtension(FileName: string): boolean;
begin
FileName := UpperCase(ExtractFileExt(m_strFileName));
result := (FileName = '.XLS') or (FileName = '.XLSX') or (FileName = '.XLSM') or (FileName = '.XLSB');
end;