Hi,
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
Thank you for considering Aspose.
Please try the following sample code and attached template file as per your requirement for utilizing ICutomFunction.
Module modTest
Public Class CustomFunction
Implements Aspose.Cells.ICustomFunction
Function CalculateCustomFunction(ByVal functionName As String, _
ByVal paramsList As System.Collections.ArrayList, _
ByVal contextObjects As System.Collections.ArrayList) As Object _
Implements Aspose.Cells.ICustomFunction.CalculateCustomFunction
Dim firstParamB1 As Decimal = CType(paramsList.Item(0), Decimal)
Dim secondParamC1C25 As Array = CType(paramsList.Item(1), Array)
Dim thirdParamAnyString As String = paramsList.Item(2).ToString()
' perform your processing
Return firstParamB1
End Function
End Class
Sub <?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" />Main()
Const WORKBOOK_NAME As String = "..\..\..\test.xls"
'Open the workbook
Dim wbk As New Aspose.Cells.Workbook
wbk.Open(WORKBOOK_NAME)
wbk.CalculateFormula(False, New CustomFunction)
wbk.Worksheets(0).Cells("A1").PutValue(wbk.Worksheets(0).Cells("A1").Value)
'Save the workbook
wbk.Save(WORKBOOK_NAME)
End Sub
End Module
We will also include the example code to our online documentation soon. Also, we will provide an online demo for it soon.
Thank You & Best Regards,