Free Support Forum - aspose.com

CalculateFormula throw NullReferenceException when using references to other sheets

I'm currently evaluating the Aspose.Excel (2.6.1.0) product.
I'm running a simple Excel 2003 workbook in which i've got a cell formula ("=Sheet2!C8") using a reference to an other sheet in the same workbook.

I'm running this simple C# code:

string strWorkBookFile = "";
Aspose.Excel.Excel oExcel = null;
Aspose.Excel.Cell oCell1 = null;
Aspose.Excel.Cell oCell2 = null;

//
strWorkBookFile = "POCAsposeExcel.xls";

//
oExcel = new Excel();
oExcel.Open(strWorkBookFile);

//
oCell1 = oExcel.Worksheets["Sheet1"].Cells["A1"];
oCell1.PutValue(txtBxIn.Text);

//
oExcel.CalculateFormula();

//
txtBxOut.Text = oExcel.Worksheets["Sheet1"].Cells["A2"].StringValue;

But currently, "oExcel.CalculateFormula()" throw the a NullReferenceException ("Object reference not set to an instance of an object").

Is it related to the fact that i'm running the evaluation release 2.6.1.0?
Is it because referencing other sheets in a formula is not supported?

tx.

jf.c

I fixed this bug in v2.6.1.2. Please download it at http://www.aspose.com/Products/Aspose.Excel/Fixes/Aspose.Excel.zip.

Hi Larence,

I tested the new version of aspose.excel v3.0.30. This problem came back. Please check it out.

thanks,

Benny.

Hi Benny,

I didn’t find the problem in my machine. Could you please upload your template file and sample code here? Thank you very much.