Problem adding a reference

T

Travis Crow

I have a template (ordercode.xltm) with some VBA functions in it.

I've added this as a reference to other templates in the past with no
problem but now if I open a new template and add the reference to
ordercode.xltm (VBA Window: Tools->References) it adds OK but after
saving, closing and re-opening the template, the reference no longer
exists.

How can I get the reference to stick once set?
 
T

Travis Crow

How can I get the reference to stick once set?

NM found the problem.

If I have a function that references the referenced template code, e.g.

something=ordercode.function()

then it sticks, so I just need some VBA in the other template to do that.
 
D

Dave Peterson

The template file is used to create other files.

So how would you create a reference to any of those files that was created using
that template -- in fact, you could have no open files that used that template
-- or lots and lots of open files that used that template.

Which would would the reference point to?

You may want to consider moving the code that should be shared to a new workbook
-- an addin (*.xlam).

Then each workbook could use a reference to that addin.

Or you could open it (if it's not already open) and run the code using
application.run

Check out Ron de Bruin's site for more information:
http://www.rondebruin.nl/applicationrun.htm
 

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