XLS.GetStringFromCell read Cell in Version 7.17 but not in V7.18

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")

stringfromcell.zip (8.1 KB)

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)

This is the Excelfile the Code and the Result.
The Sheetname is Februar.
grafik
grafik
grafik

Hi,
Thanks for the file. But sadly I couldn't reproduce it here, it works fine here:

image

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?

program Project1;

{$APPTYPE CONSOLE}

{$R *.res}

uses
  System.SysUtils,
  FlexCel.VCLSupport,
  FlexCel.Core,
  FlexCel.XlsAdapter,
  Windows;

begin
  var Xls := TXlsFile.Create('.\2023.xlsx');
  Xls.ActiveSheetByName := 'Februar';

  WriteLn('GetUserDefaultLCID: ', GetUserDefaultLCID);
  WriteLn('GetThreadLocale: ', GetThreadLocale);
  WriteLn('XF: ', Xls.GetCellFormat(5, 2));
  WriteLn('Format: ', Xls.GetFormatString(Xls.GetCellFormat(5, 2)));
  WriteLn(Xls.GetStringFromCell(5, 1).ToString);
  WriteLn(Xls.GetStringFromCell(5, 2).ToString);
  ReadLn;
end.

For what it is worth, in my machine I get:
image

I get this as a Result

GetUserDefaultLCID: 1031
GetThreadLocale: 1031
XF: 182
Format: dd
43497
43497

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

Is there somthing new about this Problem?

It's been fixed, we are working now in a release which is sadly going slow due to a different issue, but we expect to have it by the end of next week

Hi,
Sorry about the delays. We've just released 7.19 which should have this fixed.

Thank you for fixing it.
Now my program works again