Reading XLS created with Google Sheets

Questions and answers on how to use XLSReadWriteII 5.
Post Reply
Brian Cheyne
Posts: 2
Joined: Wed Feb 16, 2022 9:22 am

Reading XLS created with Google Sheets

Post by Brian Cheyne »

I have clients that use Google Sheets and then save the file as and XLSX. When I try to read it I get the following error :

ExceptionMessage="Can not find workbook in OPC"

I use Delphi RAD Studio 11 with XLSReadWrite version 6.01.10
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: Reading XLS created with Google Sheets

Post by larsa »

Hello

Try:

Code: Select all

XLS.UseAlternateZip := True;
Lars Arvidsson, Axolot Data
Brian Cheyne
Posts: 2
Joined: Wed Feb 16, 2022 9:22 am

Re: Reading XLS created with Google Sheets

Post by Brian Cheyne »

Thank you Lars. I can now read the Sheet.

I have an import function that reads all sizes of Excel files and I rely on the functions FirstCol, LastCol and LastRow to find out how much data I have. These all return -1. If I interrogate Cell[0,0] the value is there, but all those functions return -1.
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: Reading XLS created with Google Sheets

Post by larsa »

Hello

Use this before reading First/Last:

Code: Select all

XLS[Sheet].CalcDimensions;
Lars Arvidsson, Axolot Data
Post Reply