ICustomFunction - #NAME and multiple functions

I have to reproduce the functionality of several add-ins when opening existing Spreadsheets and calculating the results. I have two questions


1) From what I can tell, you can only provide one CustomFunction class to the ‘Calculate’ methods, in which I would do a big switch statement on the functionName for each add-in function I’m implementing? (as opposed to somehow passing in a CustomFunction object for each function I’m reproducing).

2) Additionally, for any functions that aren’t supported yet by us, I would like to get #NAME returned back to Excel, similar to how it behaves natively if you call a function that doesn’t exist. Do I just return “#NAME” or is there a specific exception or Aspose value to return?

Thanks in advance.

Hi,


Thanks for your queries.

1) Well, I think you mean Cell.Calculate() method (that can also calculate your custom function’s evaluations). Yes, you will create one class that implements ICustomFunction interface where you do the calculations for your logic etc.

2) Well, you may simply return “#NAME” for your needs.


Thank you.