How To - Call Procedure from a Different Global Template

P

plsmith

Hi,

While runnnig a procedure in GlobalTemplate-B, I want to call a
procedure from GlobalTemplate-A. I can't recall the method for doing
this. Can you help?

Thank you!

Louise Smith
 
P

Peter Hewett

Hi (e-mail address removed)

The procedure you want to call has to be declared as Public as it needs to be visible
outside of the project you defined it in. You can then (preferably) create a project
Reference in the template making the call to the template containing the code you are
calling.

Other than that you can use Application.Run *but* it can be *very* flakey, use this method
with extreme caution as it doesn't always work and certainly not as advertised.

HTH + Cheers - Peter


(e-mail address removed), said:
 
C

Chad Knudson

The only reliable way I've seen to do this is to load up the template
temporarily as an Add-In and use the Application.Run "Module.Procedure"
method of calling it. Don't try to use Application.Run with the
"Project.Module.Procedure" method because that's not reliable.
 
P

Peter Hewett

Hi Chad Knudson

A Project Reference between the two Add-Ins is infinitely preferable.
Since the OP is taking about Global Templates (Add-Ins) they will presumably already be
loaded as Add-Ins.

Cheers - Peter


The only reliable way I've seen to do this is to load up the template
temporarily as an Add-In and use the Application.Run "Module.Procedure"
method of calling it. Don't try to use Application.Run with the
"Project.Module.Procedure" method because that's not reliable.

HTH + Cheers - 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