Error while reading cells with warning

I have an Excel file with numbers and text. All the cells in this Excel are formatted as text.(Format cell à Number (tab)à Text). In one cell the data is “$123.45” without the quotes. After doing this excel will show a green warning which says that “the number in this cell is formatted as text or preceded by an apostrophe”. We need to keep the cells as text and do not want to convert it to number or a currency.

I then saved the excel and used Aspose.Cells to read the data from these cells by spreadsheet.Row[2].Cell[5].Text. This will return incorrect values than what we see in the excel sheet. That is instead of “$123.45” I get “123.45” and instead of “(0.044)” I get “-0.044”. Why am I not getting the value which I have written as it is? When I open the next time the same document in excel, I am getting the same data which I have written along with warning, but why does Aspose.Cells not return the same value. What should I be doing to get this value?

I am using Aspose.Cells version and it is a licensed version.


Well, I don't find the problem you have mentioned.

Following is my testing code, I read the correct values in the cells.:

Workbook workbook = new Workbook();
workbook.Open("d:\\test\\Sample Excel.xls");
Worksheet sheet = workbook.Worksheets[0];
Cells cells = sheet.Cells;

workbook.Save("d:\\test\\out_Sample Excel.xls");

I am using the lastet version, could you try it.

Thank you.