Hi Rog,
Actually Eugene, I was able to do this:
MsgBox Application.COMAddIns.Item(1).Description
and it was my add in, but then how do I call my code from the macro?
In the COM Addin's OnConnection event, add the line:
AddinInst.Object = Me
and a public property or method. So the Designer class might look like:
Private Sub AddinInstance_OnConnection(ByVal Application As Object, _
ByVal ConnectMode As AddInDesignerObjects.ext_ConnectMode, _
ByVal AddInInst As Object, custom() As Variant)
AddInInst.Object = Me
End Sub
Public Sub ShowMessage()
MsgBox "In Addin"
End Sub
And let's say the project is called "MyAddin" and the Designer class is
called "dsrConnect"
Then, from VBA, you can show the message by calling:
Application.COMAddIns("MyAddin.dsrConnect").Object.ShowMessage
and any other public properties or methods you add to that class can be
accessed similarly.
Regards
Stephen Bullen
Microsoft MVP - Excel
www.oaltd.co.uk