#1   Report Post  
reddog9069
 
Posts: n/a
Default Template with macros


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?


--
reddog9069
------------------------------------------------------------------------
reddog9069's Profile: http://www.excelforum.com/member.php...o&userid=24458
View this thread: http://www.excelforum.com/showthread...hreadid=388166

  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

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

reddog9069 wrote:

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?

--
reddog9069
------------------------------------------------------------------------
reddog9069's Profile: http://www.excelforum.com/member.php...o&userid=24458
View this thread: http://www.excelforum.com/showthread...hreadid=388166


--

Dave Peterson
  #3   Report Post  
reddog9069
 
Posts: n/a
Default


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 actually
on the worksheet, not a toolbar button. They do not work.
My template is named Subtask.xlt and lets say I have a workbook called
test.xls.

When I right click on one of the tabs at the bottom then click
Insert...
I select Subtask.xlt and it gives me the warning that this sheet
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 few
procedures in it, one being AddMonth.

From the this description can someone please provide more insight.


--
reddog9069
------------------------------------------------------------------------
reddog9069's Profile: http://www.excelforum.com/member.php...o&userid=24458
View this thread: http://www.excelforum.com/showthread...hreadid=388166

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Disable macros in template d/l from MS? Ferret Daddy New Users to Excel 1 February 9th 05 01:54 AM
Enabling macros Peter M Excel Discussion (Misc queries) 3 February 7th 05 11:57 PM
sorting with macros Sorting in macros Excel Discussion (Misc queries) 1 February 1st 05 10:02 AM
Transferring toolbars and macros to other computers Darrell Excel Discussion (Misc queries) 1 January 19th 05 01:21 AM
Macros disappear after a file is imported Brent E Excel Discussion (Misc queries) 1 December 18th 04 01:25 AM


All times are GMT +1. The time now is 04:22 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"