Error Checking in Aspose.Cell

I am using Aspose.cell version 8.2.0.2. I am checking error. After double click in cell I am getting error “Number stored as Text”. I am using below code.


Dim opts As ErrorCheckOptionCollection = workBook.Worksheets(1).ErrorCheckOptions
Dim index As Integer = opts.Add()
Dim opt As ErrorCheckOption = opts(index)
opt.SetErrorCheck(ErrorCheckType.TextNumber, False)
opt.AddRange(CellArea.CreateCellArea(0, 0, workBook.Worksheets(1).Cells.MaxRow, workBook.Worksheets(1).Cells.MaxDataColumn))

Hi,


Thanks for providing us some details and sample code.

After an initial test, I observed the issue as you mentioned by using the following
sample code, the error checking option “Number stored as Text” is not
working by Aspose.Cells APIs. I have tested your scenario/ case a bit
using the following sample code and it does not work for both XLS and
XLSX output file formats.

e.g


Sample code:


//Instantiate a new Workbook.

Workbook workbook = new Workbook();


//Input a value to A1 cell.

workbook.Worksheets[0].Cells["A1"].PutValue("1e1");


//I even tried to disable the Excel options but to no avail.

// //Instantiate the error checking options

ErrorCheckOptionCollection opts = workbook.Worksheets[0].ErrorCheckOptions;


int index = opts.Add();

ErrorCheckOption opt = opts[index];


//Disable the numbers stored as text option

opt.SetErrorCheck(ErrorCheckType.TextNumber, false);


workbook.Save("e:\\test2\\outerrorcheckoptions1.xls");
workbook.Save("e:\\test2\\outerrorcheckoptions2.xlsx", SaveFormat.Xlsx);

I have logged a ticket with an id "CELLSNET-43077" for your issue. We will look into it soon.

Once we have any update on it, we will let you know here.


Thank you.

Hi,

Thanks for using Aspose.Cells.

Please set the range where this setting works. Please see the following code

C#


Workbook workbook = new Workbook();


//Input a value to A1 cell.

workbook.Worksheets[0].Cells[“A1”].PutValue(“1e1”);


ErrorCheckOptionCollection opts = workbook.Worksheets[0].ErrorCheckOptions;



int index = opts.Add();


ErrorCheckOption opt = opts[index];


//Disable the numbers stored as text option

opt.SetErrorCheck(ErrorCheckType.TextNumber, false);


opt.AddRange(CellArea.CreateCellArea(“A1”, “B10”));