What is the format of the string returned by Cell.StringValue?


#1

Is it supposed to be formatted per the format specification within the excel file? The documentation does not indicate whether or not that is the case. In most cases, it appears that it obeys the format specification, but not always.

In my situation, within the excel file, there is a formula cell with a negative numeric result. In excel, it displays correctly as ($1234). From Aspose, we get $-1234.

I can post a spreadsheet if necessary

Thanks


#2

Please post your spreadsheet here. I will check it right now.


#3

Refer to the attached file

//set license
....
Excel excel = new Excel();
excel.Open("AsposeWorkbook.xls");
excel.Worksheets[3].Cells["D12"].PutValue("AsposeTest");
excel.Worksheets[3].Cells["I19"].PutValue(250);
excel.CalculateFormula(false);
System.Console.Out.WriteLine(excel.Worksheets[1].Cells["F21"].StringValue);

Thanks



#4

Please try this attached fix.

By the way, Aspose.Excel is changed to Aspose.Cells. So please change your importing namespace.


#5

I think this has introduced a bug for positive numbers. Now sheet[1].Cells["h56"] is incorrectly being displayed in the form "$1234_)"

Shari


#6

Hi Shari,

Please try this attached fix.


#7

That appears to have fixed the issue. Thanks!