macros and templates

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a macro saved to a comand button in a template. The problem is that
is I save the template turning it into an .xls file the macro does not work.
Any suggestions
 
Is this a commandbutton from the Control toolbox toolbar that was placed on a
worksheet?

If yes, it should work ok.

If no, you may want to explain more.
 
yes, that is how I created the commandbutton. The button works fine when I
open the template. It doesnot work when I save the template as an .xls file
with a different name
 
I'm guessing that you didn't use a commandbutton from the Control toolbox
toolbar. I'm guessing that you used a button from the Forms toolbar.

If you select the button/commandbutton, then look at the namebox (to the left of
the formula bar), what do you see?

Is it a name like: Button 1
or a name like: CommandButton1

If you rightclick on the button, do you see an option for Assign macro? If you
see either "button 1" in the namebox or the option for Assign macro, then your
button is from the Forms toolbar.

You can use that button, but it's more work. You'll have to re-assign the macro
that's in the correct .xls file.

But in this case, I'd delete that forms toolbar button and replace it with
commandbutton from the Control toolbox toolbar.
 
Your right my mistake. That was my problem, I did use the forms toolbar. I
tried doing it through VBA, which I am somwhat new at, and I could not get it
to be displayed in my worksheet. I think that was my main problem, and I
could get it from there. Thanks
 
Back
Top