Using UDF in COM Addin as formula in worksheet

  • Thread starter Thread starter Ralf Zimmermann
  • Start date Start date
R

Ralf Zimmermann

I have written a COM addin in VB to store user defined data in
CustomDocumentProperties of a workbook. Now i want to insert these props in
a cell
like

Application.ActiveCell.FormulaR1C1 = "=GETPROPERTY(""" &
sPropertyName & """)"

It works if i define the GETPROPERTY function directly in a module of
workbook, but i want to define this function in the COM addin without
writting a wrapper XLA. (see MSDN KnowledgeBase article Q256624 - Howto: Use
a COM Add-In Function as an Excel Worksheet function)

Is this possible???

Thanks in advance.Ralf
 
Can you make your function a DLL/xll rather than a COM Addin.
http://msdn.microsoft.com/library/e...ln=en-usgssnb=1frame=true#vsofficedev_topic16

I think you can call that directly, but the article starts out:

Microsoft Excel 2000 cannot call a function directly in a COM Add-in from a
worksheet cell formula. However, you can create a Visual Basic for
Applications (VBA) wrapper for the COM Add-in function so that the function
may be called indirectly.

If you are using xl2002, then you can use an Automation-Addin
Create a Visual Basic Automation Add-in for Excel 2002 Worksheet Functions
(Q285337)
 
Back
Top