Custom toolbar issues

pilot

Active Member
Joined
Feb 17, 2002
Messages
345
Assume macro code is saved in "This Workbook" of old.xls and assigned to a button on "MyToolbar" which is attached to old.xls. I now want to give a copy of this file to someone so I open it, then SaveAs new.xls. At this point new.xls contains (a copy of) the code in "This Workbook". If I attach MyToolbar to new.xls, the macro from the toolbar button still references old.xls.

How can I truly create a copy of the file, complete with all code from "This Workbook" and all sheets, including its own attached copy of MyToolbar with button referencing macro code in the new file?
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Have you tried attaching the code to command buttons in the workbook instead of to a toolbar?

This worked for me when I emailed multiple copies of one spreadsheeet to about 50 people at different locations around the country.
 
Upvote 0
No, I haven't tried that. Do command buttons stay on top regardless of which sheet is selected?

Also, can someone give a 5 cent explanatioon of when you want code in "This Workbook" vs. when it would be better in a module attached to the workbook?
 
Upvote 0
Trying this again. How can command buttons be made to stay on top regardless of which worksheet is selected or visible? Is there a way to dock a group of command buttons similar to a toolbar? What I really want is the functionality of a custom toolbar but one that can be shared with others, with each file copy's custom toolbar buttons referring to macro code in its own file rather than pointing back to the original file.
 
Upvote 0

Forum statistics

Threads
1,213,495
Messages
6,113,992
Members
448,538
Latest member
alex78

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top