Open workbook without running Workbook_Open Event

  • Follow


I'm using Excel 2007. How do I open a workbook (the workbook is a .xls 
97-2003 format) WITHOUT running the Workbook_Open event? I tried holding down 
the SHIFT key while opening as this worked in previous versions of Excel, but 
the event still runs (unfortunately, there is an ActiveWorkbook.Close at the 
end of my code so I can't get in to modify it :(

I'm sure there is a simple way to do this in 2007 but I do not know it. 
Thanks for the help.
0
Reply Utf 5/12/2010 6:44:01 PM

Hi Domenick

I read more about this problem
Works OK for me when I use Office Button>Open and hold the Shift key

Change your security so you have the option to disable Macro's



-- 

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm



"Domenick" <Domenick@discussions.microsoft.com> wrote in message news:BC6B1847-2003-4D1E-A622-D1AC7F104E1B@microsoft.com...
> I'm using Excel 2007. How do I open a workbook (the workbook is a .xls 
> 97-2003 format) WITHOUT running the Workbook_Open event? I tried holding down 
> the SHIFT key while opening as this worked in previous versions of Excel, but 
> the event still runs (unfortunately, there is an ActiveWorkbook.Close at the 
> end of my code so I can't get in to modify it :(
> 
> I'm sure there is a simple way to do this in 2007 but I do not know it. 
> Thanks for the help. 
0
Reply Ron 5/12/2010 6:50:22 PM


Disable Macros? If you automatically enable them then you'll have to
change the security level first. You can still edit vba and save. 



Domenick;722440 Wrote: 
> 
I'm using Excel 2007. How do I open a workbook (the workbook is a .xls
> 97-2003 format) WITHOUT running the Workbook_Open event? I tried
holding down
> the SHIFT key while opening as this worked in previous versions of
Excel, but
> the event still runs (unfortunately, there is an ActiveWorkbook.Close
at the
> end of my code so I can't get in to modify it :(
> 
> I'm sure there is a simple way to do this in 2007 but I do not know
it.
> Thanks for the help.


-- 
p45cal

*p45cal*
------------------------------------------------------------------------
p45cal's Profile: http://www.thecodecage.com/forumz/member.php?u=558
View this thread: http://www.thecodecage.com/forumz/showthread.php?t=202323

http://www.thecodecage.com/forumz

0
Reply p45cal 5/12/2010 6:53:26 PM

There are lots of times when I don't want events to "fire" besides just 
workbook open, so I've put a little sub in my personal.xlsb to toggle 
Application.EnableEvents between True and False, and assigned it to a custom 
button on my quick launch toolbar.  Then I just open Excel and click the 
custom button to disable events before opening a file where I don't want the 
Open event code to run.

"Domenick" wrote:

> I'm using Excel 2007. How do I open a workbook (the workbook is a .xls 
> 97-2003 format) WITHOUT running the Workbook_Open event? I tried holding down 
> the SHIFT key while opening as this worked in previous versions of Excel, but 
> the event still runs (unfortunately, there is an ActiveWorkbook.Close at the 
> end of my code so I can't get in to modify it :(
> 
> I'm sure there is a simple way to do this in 2007 but I do not know it. 
> Thanks for the help.
0
Reply Utf 5/12/2010 7:37:01 PM

That's a good suggestion. Just curious: Does your custom button indicate 
whether the EnableEvents is ON or OFF (perhaps "pushed in" for ON)? If so, 
how did you do this? Thanks.

"B Lynn B" wrote:

> There are lots of times when I don't want events to "fire" besides just 
> workbook open, so I've put a little sub in my personal.xlsb to toggle 
> Application.EnableEvents between True and False, and assigned it to a custom 
> button on my quick launch toolbar.  Then I just open Excel and click the 
> custom button to disable events before opening a file where I don't want the 
> Open event code to run.
> 
> "Domenick" wrote:
> 
> > I'm using Excel 2007. How do I open a workbook (the workbook is a .xls 
> > 97-2003 format) WITHOUT running the Workbook_Open event? I tried holding down 
> > the SHIFT key while opening as this worked in previous versions of Excel, but 
> > the event still runs (unfortunately, there is an ActiveWorkbook.Close at the 
> > end of my code so I can't get in to modify it :(
> > 
> > I'm sure there is a simple way to do this in 2007 but I do not know it. 
> > Thanks for the help.
0
Reply Utf 5/13/2010 2:27:01 PM

Private Sub CommandButton1_Click()
With Application
    If .EnableEvents = True Then
        .EnableEvents = False
        CommandButton1.Caption = "Disabled"
    Else
        .EnableEvents = True
        CommandButton1.Caption = "Enabled"
    End If
End With
End Sub


Gord Dibben  MS Excel MVP

On Thu, 13 May 2010 07:27:01 -0700, Domenick
<Domenick@discussions.microsoft.com> wrote:

>That's a good suggestion. Just curious: Does your custom button indicate 
>whether the EnableEvents is ON or OFF (perhaps "pushed in" for ON)? If so, 
>how did you do this? Thanks.
>
>"B Lynn B" wrote:
>
>> There are lots of times when I don't want events to "fire" besides just 
>> workbook open, so I've put a little sub in my personal.xlsb to toggle 
>> Application.EnableEvents between True and False, and assigned it to a custom 
>> button on my quick launch toolbar.  Then I just open Excel and click the 
>> custom button to disable events before opening a file where I don't want the 
>> Open event code to run.
>> 
>> "Domenick" wrote:
>> 
>> > I'm using Excel 2007. How do I open a workbook (the workbook is a .xls 
>> > 97-2003 format) WITHOUT running the Workbook_Open event? I tried holding down 
>> > the SHIFT key while opening as this worked in previous versions of Excel, but 
>> > the event still runs (unfortunately, there is an ActiveWorkbook.Close at the 
>> > end of my code so I can't get in to modify it :(
>> > 
>> > I'm sure there is a simple way to do this in 2007 but I do not know it. 
>> > Thanks for the help.

0
Reply Gord 5/13/2010 2:53:42 PM

5 Replies
477 Views

(page loaded in 0.116 seconds)

Similiar Articles:













8/1/2012 10:22:21 AM


Reply: