Free Support Forum -

Custom defined function


I have an excel sheet with custom defined functions. When I am importing this sheet into Aspose.Grid or Aspose.Cells the functions are not imported. I would like to see them in the cell.formula property of Aspose.Grid and handle the calculation of the formula's in the underlying code.

Rob Vader


I defined a custom function named "myfunc" in EXCEL, and put a formula "=myfunc()" is cell "A1", then saved to a xls file. When I open the file in the gridweb, it shows "#NAME?". But the cell's Formula property is correct. So please give me more information about what you really want to do against the custom funciton.

Thank you.

the problem occurs when I have my functions embedded in a XLA file attached as an add-in to my XLS file.

The ImportExcelFile function will not return the function.

I tried to load a XLS file with Aspose.Cells using the following code:

Dim EXCEL As New Workbook


Dim cll As Cell

Dim wb As Worksheet


For Each wb In EXCEL.Worksheets


For Each cll In wb.Cells

If cll.IsFormula Then

Me.GridWeb1.WebWorksheets(wb.Index).Cells(cll.Row,cll.Column).Formula = cll.Formula



End If



The cell.IsFormula is triggered but cell.Formula does not have a value

Which version of Aspose.Cells are you using? Have you tried latest v4.1?

If it still doesn't return a correct formula, could you please post your Excel file here? Thank you.