Template with macros

R

reddog9069

Whenever I have a workbook and insert a new sheet from the template with
the macros, the macros never come with the template to the new
workbook.

Is there something I have to do differently?
 
D

Dave Peterson

When you add the sheet, the macros behind that sheet (in the template) should
show up.

But the code in general modules won't come along for the ride.

One way around it is to keep the macros as text files and import those text
files (or to open the template workbook, export the modules and then reimport
them into your new project).

Chip Pearson has some code that shows how to do this:
http://www.cpearson.com/excel/vbe.htm
 
R

reddog9069

Thanks for the response-
When you add the sheet, the macros behind that sheet (in the template
should show up.

I have macros assigned to buttons. This is a button that is actuall
on the worksheet, not a toolbar button. They do not work.
My template is named Subtask.xlt and lets say I have a workbook calle
test.xls.

When I right click on one of the tabs at the bottom then clic
Insert...
I select Subtask.xlt and it gives me the warning that this shee
contains macros and I enable macros.

When I hit the button that the macro is assigned to it says
The macro 'test.xls!AddMonth.AddMonth' cannot be found.

I have a module in Subtask.xlt that is named AddMonth and has a fe
procedures in it, one being AddMonth.

From the this description can someone please provide more insight
 

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