Free Support Forum - aspose.com

Get list of all formulas/AddIns

hi Aspose.cells support,


I understand VB can simply modify the Excel formula’s and AddIns.

But, is there a function that returns directly all formulas and AddIns within a spreadhseet. Now I need to move to the individual cells.

Also, what is the difference between using the SetAddInFormula on the cell and coding it directly within the formula
eg
ws.Cells(“A1”).SetAddInFormula(“whatever.xla”, “=FUNCTION1(A2)”)
versus
ws.Cells(“A1”).Formula = "=FUNCTION1(A2)"

thank you,



Hi,


I am afraid, there is no such function/feature available that returns all the formulas and Add-ins in the spreadsheet in one go/step. You have to loop through the cells in a sheet and use Cell.Formula attribute to get the formulas accordingly.

Also, the SetAddInFormula is used to set add-ins formula to a cell while Cell.Formula is used to set MS Excel’s standard built-in formulas/functions, see the document for reference:
http://www.aspose.com/docs/display/cellsnet/Using+Formulas+or+Functions+to+Process+Data

1.

Ok, I understand there is no function to get all formula’s in a sheet,

2.
But I dont understand your comment on the difference between formula and SetAddInFormula.
In Excel, I can directly enter an AddIn by just typing it like a normal Excel formula. There is no difference whether it is internal Excel, or if it is contained in an extra file. Why is that then different in Aspose.Cells ?

3.
So is there also an GetAddInFormula, or how can I see that a cell contains a call to an external AddIn ?

thanks a lot,

guido

Hi,


2) Yes, the add-ins formulas’ definition/info can be existed in an xla file separately. Anyways, we will provide you further details on it soon.

3) No, I am afraid, there is no GetAddInFormula method available in the product’s APIs, you have use Cell.Formula for all types of formulas now. And, we have logged a ticket with an id “CELLSNET-41360” for it now. We will check it if we can support it.

Thank you.

Hi,

Thanks for your posting and using Aspose.Cells for .NET.

FYI: In Excel, there are two types of non built-in functions: Macro and Addin. We could not know which type is an unknown function.

So we added Cell.SetAddInFormula method and CellsHelper.AddAddInFunction() to set addin function.

As you can directly enter an AddIn by just typing it like a normal Excel formula in Excel, you do not need to call Cell.SetAddInFormula method.

Please call CellsHelper.AddAddInFunction() to initialize all your addin functions before construct the workbook instance.

Please see the following code.

C#


CellsHelper. AddAddInFunction(FUNCTION1,…);

Workbook workbook = new Workbook();

Worksheet ws = workbook.Worksheets[0];

ws.Cells[“A1”].Formula = “=FUNCTION1(A2)”

The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan