Excel Workbook with Macros Running and another new Excel workbook opens causes error message

nmk34

New Member
Joined
Apr 12, 2022
Messages
40
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
I have this workbook with macros running and programmed to minimize or password to close the workbook .This workbook collects data 24 hours with breaks between shifts. if someone minimized it then started a new workbook, Excel popup indicating that this "macro1" not a variable on this new workbook and closes the original workbook with macros. the second new workbook and the popup can not be close except thru Task Manager. is there a work around and maybe limit excel to one instance?
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
I suspect your code uses things like ActiveWorkbook and ActiveSheet - so when it runs the other book/sheet is the active object. That's the risk of using active object references. If not the case I don't know, otherwise perhaps see this for the differences

 
Upvote 0
thank you for your response. the data collection software was trying to write to any open excel workbook. i changed the settings to restrict the software to write only a specific workbook and that resolved the problem and no more error. as far as the new Excel instance prevention, i change the excel options under advance, then General to ignore other DDE programs.
 
Upvote 0
Solution

Forum statistics

Threads
1,215,003
Messages
6,122,655
Members
449,091
Latest member
peppernaut

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