access object in non-referenced add-in

  • Thread starter Thread starter Robert Schwenn
  • Start date Start date
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
 
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.
 
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
 
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
 
Back
Top