MS Security not consistant....NEED HELP!!!

atf32

Board Regular
Joined
Apr 13, 2011
Messages
157
I have a workbook(Main) with VBA that opens a secondary target file and copies certain tabs back into then Main file. This all works fine except that I noticed recently that the code only works if I opened up the VBE before running the code to copy in the Main file. When it works right, I get the "Microsoft Excel Security Notice" that asks me to "Enable Macros" or "Disable Macros". To which I press to enable, and then the code continues through the rest of the routine. If I don't open the VBE before I run the routine, I get a different "Microsoft Excel Security Notice" that warns me about copying from the secondary file, because it has macros and that I should only go forword if I trust the source of the file. And the option buttons it gives me is "Yes, continue the operation" and "No, stop the operation". When I press "Yes, continue the operation", if copies in the tab, but then stops the routine and does not finish.

Note: this does not happen with other routines that do the same thing. Also, as I mentioned earlier, this does not happen if I open the VBE before I run the routine. Also all files are sitting in a trusted location and my macro settings is set at "Disable all macros with notification"
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.

Forum statistics

Threads
1,203,073
Messages
6,053,379
Members
444,660
Latest member
Mingalsbe

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