ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Workbook_Open (https://www.excelbanter.com/excel-programming/318278-workbook_open.html)

Jim Zeeb[_2_]

Workbook_Open
 
The code in ThisWorkbook.Workbook_Open is not getting executed when the
workbook is opened. I put a Msgbox right at the top of the code and I never
see it.

InTHANKSAdvance

Frank Kabel

Workbook_Open
 
Hi
you have to put this code in your workbook module ('ThisWorkbook')

--
Regards
Frank Kabel
Frankfurt, Germany

"Jim Zeeb" schrieb im Newsbeitrag
...
The code in ThisWorkbook.Workbook_Open is not getting executed when

the
workbook is opened. I put a Msgbox right at the top of the code and

I never
see it.

InTHANKSAdvance



Norman Jones

Workbook_Open
 
Hi Jim,

One possibility is that EnableEvents has been set to false, perhaps by
interrrupted code operation.

In case this is the reason, run:

Sub Test()
Application.EnableEvents = True
End Sub

---
Regards,
Norman



"Jim Zeeb" wrote in message
...
The code in ThisWorkbook.Workbook_Open is not getting executed when the
workbook is opened. I put a Msgbox right at the top of the code and I
never
see it.

InTHANKSAdvance




Jim Zeeb[_2_]

Workbook_Open
 
It is in ThisWorkbook

"Frank Kabel" wrote:

Hi
you have to put this code in your workbook module ('ThisWorkbook')

--
Regards
Frank Kabel
Frankfurt, Germany

"Jim Zeeb" schrieb im Newsbeitrag
...
The code in ThisWorkbook.Workbook_Open is not getting executed when

the
workbook is opened. I put a Msgbox right at the top of the code and

I never
see it.

InTHANKSAdvance




Frank Kabel

Workbook_Open
 
Hiu
then post your complete code

--
Regards
Frank Kabel
Frankfurt, Germany

"Jim Zeeb" schrieb im Newsbeitrag
...
It is in ThisWorkbook

"Frank Kabel" wrote:

Hi
you have to put this code in your workbook module ('ThisWorkbook')

--
Regards
Frank Kabel
Frankfurt, Germany

"Jim Zeeb" schrieb im

Newsbeitrag
...
The code in ThisWorkbook.Workbook_Open is not getting executed

when
the
workbook is opened. I put a Msgbox right at the top of the code

and
I never
see it.

InTHANKSAdvance





Jim Zeeb[_2_]

Workbook_Open
 
I do manipulate EnableEvents.
Does this persist between invocations of Excel?

"Norman Jones" wrote:

Hi Jim,

One possibility is that EnableEvents has been set to false, perhaps by
interrrupted code operation.

In case this is the reason, run:

Sub Test()
Application.EnableEvents = True
End Sub

---
Regards,
Norman



"Jim Zeeb" wrote in message
...
The code in ThisWorkbook.Workbook_Open is not getting executed when the
workbook is opened. I put a Msgbox right at the top of the code and I
never
see it.

InTHANKSAdvance





Norman Jones

Workbook_Open
 
Hi Jim,

Does this persist between invocations of Excel?


No, Events are enabled by default each time Excel is opened. So if your
Workbook_Open code is not firing after closing and re-opening Excel, my
guess was wrong. If, howver, Events are set to false and the workbook is
re-opened, the event code would not fire.

As Frank suggested, post your code. If the code is in the correct module
(ThisWorkbook) and events are set to true, the only remaining factor that I
can think of is the code itself.

---
Regards,
Norman



"Jim Zeeb" wrote in message
...
I do manipulate EnableEvents.
Does this persist between invocations of Excel?

"Norman Jones" wrote:

Hi Jim,

One possibility is that EnableEvents has been set to false, perhaps by
interrrupted code operation.

In case this is the reason, run:

Sub Test()
Application.EnableEvents = True
End Sub

---
Regards,
Norman



"Jim Zeeb" wrote in message
...
The code in ThisWorkbook.Workbook_Open is not getting executed when the
workbook is opened. I put a Msgbox right at the top of the code and I
never
see it.

InTHANKSAdvance







Norman Jones

Workbook_Open
 
Hi Jim,

One other thought, how are you opening the workbook?

---
Regards,
Norman



"Jim Zeeb" wrote in message
...
I do manipulate EnableEvents.
Does this persist between invocations of Excel?

"Norman Jones" wrote:

Hi Jim,

One possibility is that EnableEvents has been set to false, perhaps by
interrrupted code operation.

In case this is the reason, run:

Sub Test()
Application.EnableEvents = True
End Sub

---
Regards,
Norman



"Jim Zeeb" wrote in message
...
The code in ThisWorkbook.Workbook_Open is not getting executed when the
workbook is opened. I put a Msgbox right at the top of the code and I
never
see it.

InTHANKSAdvance







Dave Peterson[_5_]

Workbook_Open
 
And to piggyback on Norman's leading question...

If you're opening the workbook via a macro and use a shortcut key that includes
the Shift key, remove the shiftkey from the shortcut key combo.

Holding the Shiftkey down when you're opening a workbook stops the auto_open and
workbook_open code from running. And excel gets confused about your shiftkey in
the shortcut key combination.

Norman Jones wrote:

Hi Jim,

One other thought, how are you opening the workbook?

---
Regards,
Norman

"Jim Zeeb" wrote in message
...
I do manipulate EnableEvents.
Does this persist between invocations of Excel?

"Norman Jones" wrote:

Hi Jim,

One possibility is that EnableEvents has been set to false, perhaps by
interrrupted code operation.

In case this is the reason, run:

Sub Test()
Application.EnableEvents = True
End Sub

---
Regards,
Norman



"Jim Zeeb" wrote in message
...
The code in ThisWorkbook.Workbook_Open is not getting executed when the
workbook is opened. I put a Msgbox right at the top of the code and I
never
see it.

InTHANKSAdvance




--

Dave Peterson


All times are GMT +1. The time now is 08:08 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com