I have created an automation addin in C# .NET and have a shim dll for it. The shim dll has all the User Defined methods in it that calls the appropriate methods in the .NET assembly.
The problem that I am facing is related to Excel 2007.
In Excel 2003, 1. Add a new shape to a worksheet 2. Insert >> Function >> SUM. The Function arguments dialog comes up 3. click on the newly inserted shape instead of a cell Note: Nothing happens and no cell value is entered automatically in the argument box
Now in Excel 2007, 1. Insert a new shape 2. Formulas Ribbon Tab >> Insert Function >> SUM. Function Arguments dialog comes up 3. Click on the newly inserted shape Note that now an error dialog is displayed saying "The formula you typed contains an error"
This dialog comes up for a predefined function (SUM). If I select my function from the list in-place of SUM, the error dialog is not displayed and the Function Argument dialog just vanishes. The cell then shows an error smarttag.
Is there something that needs to be put into the SHIM dll for each function? Like an attribute or something that will display this error dialog. OR maybe some special value that is returned by the method to tell that the argument has generated an error.
The function defined in the COM shim are like:
STDMETHOD(GetArea)(MyExcelAddIn::Range *r, double *pRetVal)
{
return m_pMyUDF->GetArea(r, pRetVal);
}