Cell Comment handling when reading xls files
Posted: Mon Nov 16, 2015 6:25 am
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
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