Open - Only Reading - Marked as 'Dirty'

Sep 16, 2010 at 3:41 AM

I'm using ExtremlML to read from 1 file (File A) and write to another (File B). I'm calling SpreadSheetDocumentWrapper.Open, reading the values I need using GetCellValue<>, then calling Dispose on the package (on File A). Most of the values I'm reading are the result of formula's, not static values.

The issue that I'm facing is that calling GetCellValue only works the first time my code is executed. Subsequent executions return a null value for the cells that have values based on formula's. If I open the xslx in Excel, save it, then execute my code again, it works. But only for one time, then I'm back to getting null values.

I've looked around and have learnt formula's can't be calculated using the SDK, and that if formula's are changed in code using the SDK, the xlsx has to be opened and saved from Excel for the formula's to be executed. What I don't understand is why I'm having the this issue, because:

1. I'm not changing anything in this spreadsheet; just reading values.

2. Using the SDK to read the values I want does not have the same issue. I can call the same method over and again using the SDK, and it will return a value everytime. But as soon as I open the doc and read the values once using ExtremeML, I get null values back, even when directly using the SDK.

 

So it looks like ExtremeML is somehow marking this file as 'dirty', or modified, and xslx is dropping the cached values for the formula's. Has anyone else noticed this? Am I doing something wrong in my code for this to happen? Or am I way off?

 

Thanks

 

 

 

Coordinator
Sep 16, 2010 at 8:03 AM

Having just checked the code for GetCellValue<>, I can confirm that it does not modify anything.

Can you please perform a test to determine whether the problem is occuring at a higher level? I recommend introducing an operation into your code that simply opens and closes your template file without reading or writing anything. After running this code, you will need to repeat your original read operation to see whether the values are now null.

If you can post your results here, I will investigate further. It may be that there is something in your template (I suspect something to do with the state of the calculation chain) that is causing ExtremeML to null the cell values.

Thanks,

Tim