We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Accessing Application.CalculationState

Hi


We are calling CalculateFormula on a workbook with a lot of calculations but the calculations are still running when our code starts to read results from the spreadsheet.

Is there a way to determine if the calculations are still running such as accessing the calculationstate property available in Excel?

Thanks

Scott

Hi Scott,

We have logged this request with ID CELLSJAVA-19798 into our system. We will look for the provision of this feature and will update you as soon as possible.

Thanks,

Hi,

I think you are accessing the workbook with multiple threads because calculateFormula() method will not return before the calculation finished. For your situation, I think you can keep a flag in your thread that calls calculateFormula() to represent whether the calculation is finished or not. please fine the sample code sample below:


class XXX

{

boolean calculating=false;



void doCalc()

{

calculating=true;

try

{

workbook.calculateFormula(); //here also you can call Worksheet.calculateFormula(…) methods instead and keep the state of calculation

}

finally

{

calculating=false;

}

}

public boolean getCalculationState()

{

return calculating;

}

}



Thank you.