Obtain collection of all custom functions in a workbook in .NET

Hi Aspose,

I would like to obtain all non-excel formulas from a workbook (for example formulas from other excel add-ins like Oracle HFM, etc.). All these formulas start with “=” but aren’t resolved by excel (only by the AddIns). Do we have a method in Aspose.Cells which returns the collection with all custom functions from a workbook ?


Thank You in advance,
Vitalie Semenciuc
Software Developer at IBM Romania

Hi,

Thanks for your posting and using Aspose.Cells.

We are afraid this feature is not available. However you can extend Aspose.Cells default calculation engine using the AbstractCalculationEngine class. Now you will have access to all native and non-natives custom functions. You can then implement a static count of non-natives custom functions. Let us know your feedback if it suits your requirements.

( Implement Custom Calculation Engine to extend the Default Calculation Engine of Aspose.Cells|Documentation )

Hi again,

Should I treat every non-native (or native) function separately or it’s possible to access the list of all non-native (or native) functions, without treating them separately ?


Thanks in advance,
Vitalie Semenciuc
Software developer at IBM Romania

Hi,

Thanks for your posting and using Aspose.Cells.

We have logged this issue as a New Feature request in our database. We will look into it and implement it if possible. Once there is some fix or other news for you, we will let you know asap.

This issue has been logged as

  • CELLSNET-44352 - Obtain collection of all custom functions in a workbook

@ibmromania,

We have no better solution for this requirement. However, with custom calculation engine, it is simple and easy for you to gather or process those custom functions:

... 
CalculationOptions co = new CalculationOptions(); 
co.CustomEngine = new MyEngine(); 
workbook.CalculateFormula(co); 
...
 private class MyEngine : AbstractCalculationEngine 
{ 
public override void Calculate(CalculationData data) 
{ 
//here user may do with the function according to the specific requirement such as gathering the function name(data.FunctionName) 
...
 }
 }