Access Violation Saving Spreadsheet with Formula

Questions and answers on how to use XLSReadWriteII 5.
Post Reply
scott.brown
Posts: 1
Joined: Tue Nov 07, 2023 12:34 pm

Access Violation Saving Spreadsheet with Formula

Post by scott.brown »

Hello, we are having problems with saving a specific spreadsheet and I wondered if someone might have some insight on this. I can supply the spreadsheet, or you can download the template from https://www.eeocdata.org/EEO4/home/datauploadfilespecs under 2023 EEO-4 Data Upload File Layout Specifications if you'd prefer to get it from the source.

I was able to get this access violation to popup just by loading with .LoadFromFile and saving with .Write, so no actual modification is needed to get this to happen. From what I can trace, it seems to be a problem in the TXLSFormulaDecoder.Decode method on the formula defined as TitleRegion1.a1.p121.3. It looks like the ID of APtgs at that point indicates it's a table column, but the following line doesn't have a value assigned for FCurrTables:

Code: Select all

FStack.Push(Spaces + FCurrTables[PXLSPtgsTableCol(APtgs).TableId].TableColumns[PXLSPtgsTableCol(APtgs).ColId].Name);
We compared this to the previous version of this spreadsheet and the layouts are the same, but the previous version didn't have any of these defined names on it. We were able to get around this by uploading the sheet to Google Docs and saving it there, stripping out these defined names, but we'd like to figure out the issue and if we need to handle it differently in case we aren't allowed to do that in the future. Would someone be able to point me in the right direction on this one? I can provide a sample program if you'd like, but really all it does is load and save the file.

Scott
Post Reply