View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Using UDF in COM Addin as formula in worksheet

Can you make your function a DLL/xll rather than a COM Addin.
http://msdn.microsoft.com/library/en...icedev_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)


--
Regards,
Tom Ogilvy

"Ralf Zimmermann" wrote in message
...
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