Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to keep macros attached when moving sheet to a new workbook

I need to move sheets back and forth between different workbooks, and I
have no idea how to keep the macros attached to the graphical buttons
on the sheet itself. When I use the buttons (they have macros attached
to add new row), it searches for the old file it came from, even if the
correct macros are attached to the sheet, and I have to re-link the
buttons. Any ideas how to make the path automatically re-assign itself
to the macros in the new workbook?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default How to keep macros attached when moving sheet to a new workbook

You'll have to reassign the buttons to the macros in the new workbook. So those
macros have to be copied over, too.

If you're moving the sheets, you may be able to just dump those controls from
the Forms (?) toolbar and use the commandbuttons from the Control toolbox
toolbar.

The code for these controls lives under the worksheet--so it gets copied when
the sheet gets copied.

wrote:

I need to move sheets back and forth between different workbooks, and I
have no idea how to keep the macros attached to the graphical buttons
on the sheet itself. When I use the buttons (they have macros attached
to add new row), it searches for the old file it came from, even if the
correct macros are attached to the sheet, and I have to re-link the
buttons. Any ideas how to make the path automatically re-assign itself
to the macros in the new workbook?


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default How to keep macros attached when moving sheet to a new workbook

Another option may be to remove the buttons and code completely and add a
toolbar that has icons which run macros against the activesheet.

It may be less work if you ever have to update one of those macros--since they
would only be in one location.

wrote:

I need to move sheets back and forth between different workbooks, and I
have no idea how to keep the macros attached to the graphical buttons
on the sheet itself. When I use the buttons (they have macros attached
to add new row), it searches for the old file it came from, even if the
correct macros are attached to the sheet, and I have to re-link the
buttons. Any ideas how to make the path automatically re-assign itself
to the macros in the new workbook?


--

Dave Peterson
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
Moving Sheet to Closed Workbook Roger Excel Discussion (Misc queries) 0 January 13th 08 05:16 PM
I get a macro warning when there are no macros attached JenML5 Excel Programming 2 April 21st 05 10:18 PM
Can I prevent a sheet from moving within a workbook? JDGUILTY Excel Programming 1 March 1st 05 05:53 PM
Can I prevent a sheet from moving within a workbook? JDGUILTY Excel Programming 4 March 1st 05 05:22 PM
Moving Macros with Sheets to New Workbook Brad Excel Programming 2 January 18th 05 04:32 PM


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

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

About Us

"It's about Microsoft Excel"