View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
scotty[_2_] scotty[_2_] is offline
external usenet poster
 
Posts: 9
Default calling a method on an object created in a different addin

I wonder if this is possible. I am a newbie by the way.

Addin1 has a function called obj that returns an object that is
created with methods etc.

Public Function obj() As MySpecialType ' type from tld com interface
On Error Resume Next
' some tuff here to create object
End Function

In another separate addin (addin2) i need to be able to get a handle
to the object and call methods on this object

Set localobj = Application.run obj
localobj.dostuff...etc

I can't get this to work. I must be mis-understanding something.

PS, I am trying not to hard code in references if possible. the idea is
the code is dynamic, finds if addins are loaded, call methods on those
to merge a certain dataset.