Conflict between macros in two open workbooks

daveNYC

New Member
Joined
Sep 18, 2009
Messages
7
Hi - I have run into annoying problem that I was hoping someone has a fix for. I'm working on Mac OS X 10.5.8 with Excel 2004 (11.5.5):

I have two unrelated workbooks, Workbook1 and Workbook2, that have nothing to do with one another but each of them has some macros that I have written and which are run from command buttons.

All of the macros in Workbook1 work fine and run with no problem, as long as Workbook1 is the only one open. Ditto for Workbook2.

When they are both open, however, if I run the macro in Workbook1 first, that macro runs fine, but when I then switch to Workbook2 and try to run a macro there, Excel freezes and I have to force quit out of Excel. Same thing if I run the macro in Workbook2 first - it runs fine - but then running the macro in Workbook1 will freeze.

It looks as if running macros in Workbook1 makes Excel only "aware" of the macros in Workbook1 from then on. If I run macro1, then switch to Workbook2 and look in the macros list, it will only show the macros from Workbook1 and none from Workbook2 even though "macros from All Open Workbooks" is selected in the dropdown. The same thing occurs in reverse if I run macro2 first, then switch to Workbook1.

Is this a known issue? Is there any way for me to work around this so that I can keep both workbooks open and in use at the same time (I need to refer to them both frequently)?

Thanks,
Dave
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Correction - On playing around some more, it looks the macros in Workbook2 aren't actually "hidden" after I run macro1. I forgot that the macros in Woorkbook1 were private macros, so they were never visible in the macro list to begin with. Sorry for that Red Herring...

Also, Workbook1 never runs if Workbook2 is open, regardless of whether Macro2 has been run or not. Workbook2 will run when Workbook1 is open, as long as macro1 hasn't been run. Once macro1 has been run, Workbook2's macro stops working...

Any ideas much appreciated...
Thx
 
Upvote 0

Forum statistics

Threads
1,214,951
Messages
6,122,446
Members
449,083
Latest member
Ava19

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