View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Jack_Feeman Jack_Feeman is offline
external usenet poster
 
Posts: 47
Default Assigning macros to buttons on a custom toolbar

Thanks Steve,

Never did it that way. Should be a great learning experience for me.

Thanks again.

Jack

"STEVE BELL" wrote:

A suggested method is to have the workbook create the toolbar when it is
opened.
And delete the toolbar when it closes.

Include at the start of the code to create a line to first delete the
toolbar if it exists.

This way the users machine is not cluttered with copies of the toolbar. No
multiple copies of the toolbar exist. And when you update the workbook the
toolbar works just the way you designed it.

This should eliminate the problem for you...

--
steveB

Remove "AYN" from email to respond
"Jack_Feeman" wrote in message
...
Thanks for the quick reply, Tom.
I added a custom toolbar from the Customize dialog boxToolbarNew. Then
assigned buttons to the toolbar and assigned macros to the buttons.

To show the custom toolbar when the wookbook is opened, I added a
This_workbook_auto_open and a This_workbook_auto_close to close the
toolbar
upon closing the workbook.

"Tom Ogilvy" wrote:

I assume you mean buttons from the menus. If so, how do you create the
toolbar? (Assume custom toolbar)

--
Regards,
Tom Ogilvy

"Jack_Feeman" wrote in message
...
This is a weird problem that seemed to pop up after users were upgraded
to
Office 2003. The template was developed in Excel 2003 and seemed to
work
fine
when users had Office 2k. After users were upgraded, all macros
assignments
somehow changed to obsolete versions of the template each time a user
would
open it from either a netshare location I placed the file at or from an
email
I attached the file to.

I changed the template to a regular workbook and updated all macro
assignments to the toolbar buttons. Some problem from the .xls.

I went to the user's office and loaded in the workbook and the buttons
did
not work. I checked the macro list and there were double the amount of
macros
listed. I check ed the Window drop-down and somehow an old copy of the
template was also loaded even though I had not opened it.

I searched the harddrive and found a few old versions of the template
and
workbook which I deleted. Then I reassigned the macros to the buttons
on
the
user's machine and it works fine. But when she forwarded it to the next
user,
they experienced the same thing, the buttons did not work because they
were
referencing old versions of the workbook.

This workbook will be used across the country and I won't be able to go
around to reassign the macros on each of the users' machines.

When I assigned the macros, I selected "this workbook" to assign the
macro
to. When this issue started I tried to reassign the macros to
"file.name",
but that did not work. However, during the 'original' development, I
may
have
forgot to set that parameter and left it on the default 'All Open
Workbooks'.
Could this be the reason the macros are referencing old versions?
Doesn't
selecting "New" start a fresh workbook without any references to user
workbooks?

Thanks for any insight!
Jack