Application.Run and return result from a function

F

Flemming Dahl

Hi all,

I am using Application.Run to run a Sub from a global add-in, and this works
fine.
Application.Run "Module.SubName", "Parameter"

But I when it comes to run a function and get the result back, I am trying
this:
MyString = Application.Run "Module.FunctionName", "Parameter"

Am I doing it the right way? or can't I get the result return?

Thanks,
Flemming
 
P

Peter

You have the right idea, now just wrap the parameters to Application.Run in parentheses:

MyString = Application.Run("Module.FunctionName", "Parameter")

hth,

-Peter
 
F

Flemming Dahl

Hi Peter

Yes I just found out - how blind can one be :)

Thanks
Flemming


"Peter" <peterguy -at- hotmail -dot- com> wrote in message
You have the right idea, now just wrap the parameters to Application.Run in
parentheses:

MyString = Application.Run("Module.FunctionName", "Parameter")

hth,

-Peter
 

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