I'm trying to find a better solution for handling excel-files. I'm now using Office Windows Components for this. It works, but it's very slow.I did some testing with Aspose.Cells and after loading an excel-file and calling the CalculateFormula-method I got some #VALUE! -values in some cells. When I look at the file it looks fine.
I attached the excel-file. And below is what I did.
FileStream stream = File.Open("tiox_ws_rekenmodel_0.xls", FileMode.Open); Workbook workbook = new Workbook(stream); workbook.CalculateFormula(); Worksheet uitvoerWorksheet = workbook.Worksheets["uitvoer"]; string value = uitvoerWorksheet.Cells["B2"].StringValue;
I've been running to the same kind of problem again. This time with another excel-file (see attachment). I used the latest version of Aspose.Cells for this test.
Although we have already logged this issue and we will let you know here when its is fixed. But if you provide your template file. We can look into too.
var fs = wb.SaveToStream(); wb.CalculateFormula(false);
dt = wb.Worksheets.GetRangeByName(“Rank”).ExportToDataTable(); //all the items in the datatable now returns the value “2” which is not correct.
//If i re-instantiate the workbook from the stream then i can get the correct workbook but can’t //run calculateFormula() wb = new Workbook(fs); wb.CalculateFormula(false); dt = wb.Worksheets.GetRangeByName(“Rank”).ExportToDataTable(); //same thing, returns all 2’s.