I have been following this Tutorial to create an excel add-in in C#. This add-in gives the user a set of functions that they write into the formula bar.
For some reason this tutorial works and the cell is populated when the VBA Editor runs the Sub (Through f5), or if an Excel Form Button which is bound to the VBA Sub is clicked.
However, if the Sub is called from a function (which can be used in the formula bar), either an error (A fairly catch-all error that seems to be a 'Something happened' error) appears down in the c# code, or the cell is not populated.
Public Function methodCaller()
Call CallVSTOMethod 'Call the sub
End Function
AFAIK Call
doesn't do anything special, its meant to be a hangover from earlier versions of VBA.
My question is, how can I call a Sub from a function in a similar manner to the editor/ form click handler?
Thank you for your time.
EDIT: This is the error when i call the Sub from a function