How can I reference a procedure in an Add In?

J

June Macleod

I have an addin with the Title "Test" saved as "Test 1.xla"

In the addin I have a sub procedure named "checklegal" which takes the
argument "workbookname"

From another workbook which has the "Test" Add In loaded how can I call the
"checklegal" procedure?

Many thanks

June
 
B

Bob Phillips

Hi June,

You can either run it qualified with the addin name

Application.Run "myAddin.xla!myMacro", myWB

or you can set a reference in the vBE (Tools>References) and call it like
any other procedure.


--

HTH

RP
(remove nothere from the email address if mailing direct)
 
J

June Macleod

Thanks for answering my query.

I am afraid I had no success with the application run method. It returned a
message
"the macro 'Allomax Test 1.xla!checklegalcopy' cannot be found.

Any thoughts? The sub procedure checklegalcopy is set to Public.

The vbe method however worked a treat. Thank you very much for your help.

Regards


June
 
B

Bob Phillips

June,

That is probably because your add-in name conatains embeedded spaces, so you
need to enclose in single quotes, like so

Application.Run "'Allomax Test 1.xla'!checklegalcopy", myWB

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
J

June Macleod

Thank you. That solved it.

June


Bob Phillips said:
June,

That is probably because your add-in name conatains embeedded spaces, so you
need to enclose in single quotes, like so

Application.Run "'Allomax Test 1.xla'!checklegalcopy", myWB

--

HTH

RP
(remove nothere from the email address if mailing direct)


returned
 

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