PDA

View Full Version : Solved: Stop VBA Code From Running when Opening an Excel File??



Derek
12-05-2006, 10:20 AM
I have completed 8 hours of mind numbing work. the last part of the work I was doing on a workbook was to open it from a separate workbook, select 3 sheets, print those 3 sheets and to close it down again. (Using a workbook_open sub)

Anyone spotted my problem yet?? Yes, you guessed it. the code prints out the wrong sheets, the sheets need a bit of tinkering with and stupid appearance here has it in a loop of opening, printing and closing down again!!:banghead: :bug:

is there any way I can open up this file but have the vba code not run to allow me to actually have the file open?

I feel really stupid now!!


Derek

APOLOGIES. I FIGURED IT OUT. I SET MY SECURITY TO HIGH, AND DISABLED THE MACROS.

mdmackillop
12-05-2006, 02:46 PM
Hi Derek,
Hold down Shift when opening a file to prevent code from running.
Regards
MD

Derek
12-06-2006, 01:36 AM
Thanks, I knew there would be a simple solution, less convoluted than mine. So, Hold shift, then double click the file to open?

D

mdmackillop
12-06-2006, 01:38 AM
As long as Shift is held down, it shouldn't matter how the file is opened.