We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Can not find function: RefreshCalcEngine

Dear,
I want to calcualted excel file before saving it by XlsIO.
Some one (in forums) use RefreshCalcEngine function to calculate, but I could not find that function.

Can you help me to solve my problem.
Thanks,
Khai.

3 Replies

MW Melba Winshia Syncfusion Team August 7, 2007 10:11 AM UTC

Hi Khai,

Thank you for your interest in Essential XlsIO.

You should use Essential Calculate along with Essential XlsIO to calculate before saving the file.

[C#]

//Inserting sample text
sheet.Range["A1"].Number = 10.99;
sheet.Range["B1"].Number = 10;
sheet.Range["C1"].Formula = "A1+B1";
sheet.Range["D1"].Formula = "AVERAGE(A1:B1)";

//Refresh the calculation engine. The second parameter is true since this is the
//first time we are calling this.RefreshCalcEngine
this.RefreshCalcEngine(workbook,true);

Please refer the sample in the below link which illustrates the above.

http://websamples.syncfusion.com/samples/XlsIO.Windows/66997/main.htm

Please try running the above sample and let me know if this helps.

Thanks,
Melba





KT Khai Tran August 8, 2007 02:25 AM UTC

Thanks for your reply,
but when I create new object XlsIOCalcWorkbook

Dim cwb As XlsIOCalcWorkbook = New XlsIOCalcWorkbook(sheets, ranges)

it has an error: "Object reference not set to an instance of an object." in function:

Public Sub New(ByVal calcSheets() As XlsIOCalcSheet, ByVal namedRanges As Hashtable)
MyBase.New(calcSheets, namedRanges)
End Sub

I don't know why.
Can your help me one more time.
Thank you very much.
Khai.


MW Melba Winshia Syncfusion Team August 8, 2007 12:18 PM UTC

Hi Khai,

Thank you for posting your query to us.

I am afraid that I was not able to reproduce the issue. Please refer to the following steps that I tried to reproduce it.

1. Created a vb sample to calculate formulas before saving by creating new object XlsIOCalcWorkbook
2. Run the sample
3. No Exception

Also I have created a simple sample to test this issue and it is available in the following link.

http://websamples.syncfusion.com/samples/XlsIO.Windows/66997_1/main.htm

Please have a look at the above sample and if still the issue exists, could you please try reproducing it in the above sample or send us the reproducing steps so that we could sort out the cause of the issue and provide you a solution?

Thanks,
Melba

Loader.
Live Chat Icon For mobile
Up arrow icon