Accessing Global Template Objects

M

mamue

Hi,

how can i access classes, autotext entries, etc. of a global template
(like normal.dot) within a macro.
public methods are accessible through the
Application.Run "MyGlobalTemplate.MyMethod"
command. Is it necessary to add a method for each class, autotext,
etc. that return the object?

thanks, Matthias
 
F

fumei via OfficeKB.com

If the global is loaded you should be able to simply use an autotext from it.
You should also be able to call any procedure from it.

Sub CalledFromGlobal()
Msgbox "Hello from the global template."
End Sub

Simply using:

Call CalledFromGlobal should execute the procedure.
 
M

mamue

If the global is loaded you should be able to simply use an autotext from it.
You should also be able to call any procedure from it.

Sub CalledFromGlobal()
Msgbox "Hello from the global template."
End Sub

Simply using:

Call CalledFromGlobal should execute the procedure.

and what about classes? as far as i know Application.Run doesn't work
with classes.
 
M

mamue

Hi


It depends on what you mean. But seehttp://www.cpearson.com/excel/Classes.aspx. Chip explains how to declare
and create variables of a class type in multiple projects.

Hope this helps.

Shauna Kelly. Microsoft MVP.http://www.shaunakelly.com/word

Thanks Shauna for the link,

but i need a way to access classes of a global template that isn't
listed under references. my shared classes are kept in a template in
the startup folder.

cheers, matthias
 
T

Tony Jollans

but i need a way to access classes of a global template that isn't
listed under references. my shared classes are kept in a template in
the startup folder.

You can't. You must set a reference to a template if you want to use
anything in that template.
 

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