I read a Cell with the Command
"vDay := XLS.GetStringFromCell(4, 2);"
in Flx Version 7.17 an it works fine.
After updating to Version 7.18 i get an empty vDay: TCellValue and so also
s2 := vDay.ToString; is empty.
The Cell in the excelfile has "01" as Value in Cell 4,2 and is Writeprotected.
Please check what ist the difference from v7.17 to 7.18 in this case
Hi,
There shouldn't be any changes between 7.17 and 7.18 in GetStringFromCell. The fact that it is writeprotected shouldn't matter either, that's just a flag in the cell.
Normally the issue you are having is just related to reading the wrong sheet. Can you verify that XLS.ActiveSheet is pointing to the right sheet and not to a sheet where Cell (4,2) is empty? (The ActiveSheet if you don't modify it will be the sheet where the file was last saved when you were in Excel)
If this is not the issue, can you send me a file that shows the problem?
I've tried it here just to be 100% and it seems to be working as expected, you can see my test project attached. (I tried with both a string "01" and a number 1 formatted as "00")
Sorry, in the demo I forgot to turn write protection in the sheet, but you can try turning it on and you will see it still works. As said, I would first check that you are reading from the correct sheet (there is also an overload of GetStringFromCell that takes a sheet as a parameter, so you can't go wrong with that one). If that isn't the case, please send me a file that can reproduce the issue. (if the file has any confidential data, you can email it to adrian@tmssoftware.com and we will look at the problem and delete it after we are done)
Hi,
Thanks for the file. But sadly I couldn't reproduce it here, it works fine here:
I wonder if this could be related with localization in some way. You are getting the unformatted date serial number (43496), which is what Excel show if you formatted the cell as "General"
But the cell is formatted as "dd", which should show the day. What locale is your machine in?
The weirdest part is that we didn't change that I remember anything that could be remotely changing this. If it doesn't work in 7.18 it shouldn't work in 7.17.
Can you run the following program and let me know the results in your machine?
Thanks,
I sent a message just right after the last one that I could reproduce it in a different machine, but it seems the message didn't post, not sure why. The issue has been tracked and fixed, and we should be making a release very soon with the fix. Sorry about the inconveniences