access object in non-referenced add-in

R

Robert Schwenn

Hi,

in a thread a few days ago we saw, that a function of another add-in can be
called (without a reference to that add-in) in this way:

s = Application.Run("myAddin.xla!fct_name", arg1, arg2)

But how can be gained access to a public object variable of another plugin?
(It seems, that there cannot be returned an object via Application.Run)


Robert
 
D

Dave Peterson

First, if you use application.run, you don't need a reference to that other
addin's project.

Second, you can create a function in the addin that returns an object. Then you
can call that function.
 
R

Robert Schwenn

Dave said:
First, if you use application.run, you don't need a reference to that other
addin's project.

Second, you can create a function in the addin that returns an object. Then you
can call that function.

Ok, I was wrong: You *can* return an object by the function.

Thats why the next question: This works inside Excel. But when I run the
function from a vbscript (that is what I want), I get a runtime error, if the
function returns an object (other return types are ok):

set xl = CreateObject("Excel.Application")
set dummy = xl.Run("myAddin.xla!fct_name", arg1, arg2) 'runtime error

Robert
 
D

Dave Peterson

Are you sure you loaded myAddin.xla?



Robert said:
Ok, I was wrong: You *can* return an object by the function.

Thats why the next question: This works inside Excel. But when I run the
function from a vbscript (that is what I want), I get a runtime error, if the
function returns an object (other return types are ok):

set xl = CreateObject("Excel.Application")
set dummy = xl.Run("myAddin.xla!fct_name", arg1, arg2) 'runtime error

Robert
 

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