Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Template containing custom toolbar loses way to macros

Status
Not open for further replies.

strebor

Technical User
Nov 24, 2004
66
US
This has to do with Excel templates (.xlt) and vba for excel macros.

I have the same question as was posted in this very short thread.. thread707-1150241

Nobody answered that question (3 years ago!).

In my case, it works after I assign the macro.. but as soon as I exit from excel and re-launch... choosing to create a new workbook from the template (.xlt)... it complains that it can not find the macro. Is there a naming rule for macros that I'm missing?

I can use the Tools > Macros > way to select the macro that I want to run, but I would like to be able to just click on a button in the toolbar.

I'm using a template because I can not count on my associates to "save as..." and this is something we use over and over again for new data.

If anyone has some ideas about this I would appreciate them.

Thanks!



strebor
 





Hi,

"Tools > Macros ..."

Where do you store the macros? There is a DropDown to select one if THREE options.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Not sure. I guess I don't know when 'storing' occurs. I created the macros while working on the .xlt file.

I saved everything. When I assign a macro to a button in the 'custom' toolbar that I created there is a drop-down at the bottom..

All Open Workbooks
This Workbook
myfile.xlt

It doesn't seem to matter which one I choose.

The first time I open a worksheet from the template... it finds the macros... the next time, it doesn't.


strebor
 



"...I open a worksheet from the template..."

Why are you doing this? Aren't you supposed to create a NEW workbook using the TEMPLATE?

Opening a new workbook while in the template workbook, really does nothing other than open a new workbook that is NOT bases on your template.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Okay... I choose File > New and open a workbook based on the template.

Just traded in my old subtelty... for a NUANCE



strebor
 



Good! A NUANCE is better than any ol' thang!

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
...but that didn't solve the problem.

strebor
 




Your macro must be part of your template workbook. Alt+F11 toggles between the active sheet and the VB Editor. Do you see the Macro in a Module that is in the VB Project for the template?

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top