calling a method on an object created in a different addin

S

scotty

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.
 
S

scotty

got it working...just needed to appreciate run takes a string. doh.

Dim result
Dim obj
Set obj = Application.Run("somemeth")
result = obj.method1 etc...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top