Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Macros reassigned by XL?

Hi,

I'm trying to figure out a way to keep Excel 97 from changing where it looks
for a macro when called from a button or a menu entry.

I.E.

If there are 2 or more workbooks opened with similar buttons or Menu
entries, Excel seems to default to running macros in the last workbook
opened. After that point, those buttons and menus will only run a macro if
that last workbook is opened, or all buttons etc. are manually reassigned to
the macros in the opened book.

It there either a way to prevent this, or to save the assignments somehow so
they can be restored without having to manually redo each one?

Thanks,
David

--
"We Are Grey. We stand between the dark and the light."


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Macros reassigned by XL?

You can redo them with code. I suspect it calls the last open workbook
because the existing button was created by the last open workbook. If that
is not the case, then perhaps it is just coincidence that the button was
created when the last open workbook was open. The button's onaction
property stores the fullpath/name for the workbook where the macro is
located and is not changed dynamically (unless you rename the workbook doing
a saveas.

--
Regards,
Tom Ogilvy

"David B. Elson" wrote in message
.. .
Hi,

I'm trying to figure out a way to keep Excel 97 from changing where it

looks
for a macro when called from a button or a menu entry.

I.E.

If there are 2 or more workbooks opened with similar buttons or Menu
entries, Excel seems to default to running macros in the last workbook
opened. After that point, those buttons and menus will only run a macro

if
that last workbook is opened, or all buttons etc. are manually reassigned

to
the macros in the opened book.

It there either a way to prevent this, or to save the assignments somehow

so
they can be restored without having to manually redo each one?

Thanks,
David

--
"We Are Grey. We stand between the dark and the light."




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 535
Default Macros reassigned by XL?

Hi David,

I'm trying to figure out a way to keep Excel 97 from changing where it looks
for a macro when called from a button or a menu entry.


Have a look at my tutorial about distributing macro's he

http://www.jkp-ads.com/Articles/DistributeMacro00.htm

Look for chapter 3 and 4 about menus and toolbars.

Regards,

Jan Karel Pieterse
Excel MVP
http://www.jkp-ads.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Macros reassigned by XL?

Guys,

Thanks for the info.

David

"David B. Elson" wrote in message
.. .
Hi,

I'm trying to figure out a way to keep Excel 97 from changing where it
looks for a macro when called from a button or a menu entry.

I.E.

If there are 2 or more workbooks opened with similar buttons or Menu
entries, Excel seems to default to running macros in the last workbook
opened. After that point, those buttons and menus will only run a macro
if that last workbook is opened, or all buttons etc. are manually
reassigned to the macros in the opened book.

It there either a way to prevent this, or to save the assignments somehow
so they can be restored without having to manually redo each one?

Thanks,
David

--
"We Are Grey. We stand between the dark and the light."



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
Crtl+Z reassigned by muppet - cannot find to fix [email protected] Excel Discussion (Misc queries) 2 September 18th 06 01:40 PM
weird saving of a document with macros resulting with macros being transfered to the copy alfonso gonzales Excel Programming 0 December 12th 04 09:19 PM
convert lotus 123w macros to excel macros rpiescik Excel Programming 1 September 18th 04 01:35 PM
Macros not appearing in the Tools Macro Macros list hglamy[_2_] Excel Programming 5 October 24th 03 09:10 AM
Macro assignment to button gets reassigned John Gittins Excel Programming 1 August 5th 03 10:18 PM


All times are GMT +1. The time now is 05:42 PM.

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"