Page 1 of 1

Cell Comment handling when reading xls files

Posted: Mon Nov 16, 2015 6:25 am
by jyl
Hi,

We came across an issue where cell comment may not be handled properly when XLSReadWriteII 4/5 reads an xls file, and this may also be related to memory management.

To be more specific, we had 2 exactly same error cases where our clients complained that our program cannot read particular xls files and hang forever. We stepped into the code in cases of reading those xls files, and observed following exceptions:

1. Initial Exception: "Expected reocrd missing: TXO"
2. The 2nd Exception prepended extra message: "Error on reading shape #1 Expected reocrd missing: TXO"
3. The last Exception again prepended extra message : "Error on reading record #86, 00EC Offs: 00002951 Error on reading shape #1 Expected reocrd missing: TXO"

After this, our program hung and the control was never returned to our code of handling the exception (i.e., the try...except block wrapping the XLSReadWrite.Read statement), and Access Violation can happen at any stage of this process.

When debugging, some code gave us a hint that the cell comment could be the reason of causing this issue, and we did find cell comments in our xls files! Removing those cell comments did successfully prevent our program from hanging and our program was able to handle the exceptions raised by XLSReadWriteII, but we detected some memory leaks from XLSReadWriteII at the end.

We are using version 4 in our program, and this is the first time we have had issue with reading xls files using XLSReadWriteII. Both xls files from our clients can be opened normally without any observable error, and re-saving them does not make any difference.

We then tried to use version 5 by creating a brand new Delphi project (VCL Forms Application) with a button click invoking XLSReadWrite.Read, and we created an xls file with content in only one cell together with cell comment. All exceptions above happened again.

We would be appreciated if you could help us look into this issue.

Thanks,
Justin

Re: Cell Comment handling when reading xls files

Posted: Mon Nov 16, 2015 12:12 pm
by larsa
Hello

Please send me an excel file that causes this error.

Re: Cell Comment handling when reading xls files

Posted: Tue Nov 17, 2015 3:51 am
by jyl
larsa wrote:Hello

Please send me an excel file that causes this error.
Hi Larsa,

I've sent a sample xls file to the support email address (xxx@yyy.zzz) mentioned on the website. Please have a look at it. I couldn't find any place in the forum to upload the file.

Thanks,
Justin

Re: Cell Comment handling when reading xls files

Posted: Sun Nov 22, 2015 11:01 pm
by jyl
larsa wrote:Hello

Please send me an excel file that causes this error.

Hi Larsa,

Have you received the sample file and got time to look at it?

Justin

Re: Cell Comment handling when reading xls files

Posted: Wed Nov 25, 2015 10:05 pm
by larsa
Hello

An update that fixes this problem will be posted by the end of this week.

Re: Cell Comment handling when reading xls files

Posted: Thu Nov 26, 2015 12:13 am
by jyl
larsa wrote:Hello

An update that fixes this problem will be posted by the end of this week.
Thanks Larsa. Looking forward to the update.

Justin

Re: Cell Comment handling when reading xls files

Posted: Wed Dec 02, 2015 12:45 am
by jyl
larsa wrote:Hello

An update that fixes this problem will be posted by the end of this week.
Hi Larsa,

Would you mind notifying me when you post the update including the fix? The latest update for now is 5.20.64, which I don't think is the one including the fix.

Many thanks.

Justin

Re: Cell Comment handling when reading xls files

Posted: Wed Dec 02, 2015 3:53 pm
by larsa
Hello

This is fixed in update 5.20.65