ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Workbook Open/BeforeClose Problem (https://www.excelbanter.com/excel-programming/347014-workbook-open-beforeclose-problem.html)

Ozzy

Workbook Open/BeforeClose Problem
 
I cannot get my Workbook_Open() or Workbook_BeforeClose() macros to run when
the workbook is opened. The macros work fine in any other workbooks, just
not this one ... Any ideas?

Using XL 2003

Norman Jones

Workbook Open/BeforeClose Problem
 
Hi Ozzy,

Perhaps Events have been turned off.

Goto the VBE (Alt-F11)
Select the Immediate window (Ctrl-G)
Type: Application.EnableEvents = True
Hit Enter
Try re-loading the problematic file.

If the problem subsists, post your code.

---
Regards,
Norman



"Ozzy" wrote in message
...
I cannot get my Workbook_Open() or Workbook_BeforeClose() macros to run
when
the workbook is opened. The macros work fine in any other workbooks, just
not this one ... Any ideas?

Using XL 2003




Ozzy

Workbook Open/BeforeClose Problem
 
Good idea Norman, tried it but to no effect. The code is not the problem, I
have replaced it with a simple message box pop-up but it still does not
work.. The code works fine when it is run directly after the workbook is open.

Cheers, Ozzy

"Norman Jones" wrote:

Hi Ozzy,

Perhaps Events have been turned off.

Goto the VBE (Alt-F11)
Select the Immediate window (Ctrl-G)
Type: Application.EnableEvents = True
Hit Enter
Try re-loading the problematic file.

If the problem subsists, post your code.

---
Regards,
Norman



"Ozzy" wrote in message
...
I cannot get my Workbook_Open() or Workbook_BeforeClose() macros to run
when
the workbook is opened. The macros work fine in any other workbooks, just
not this one ... Any ideas?

Using XL 2003





Dave Peterson

Workbook Open/BeforeClose Problem
 
You do have those procedures in the ThisWorkbook module, right?

Ozzy wrote:

Good idea Norman, tried it but to no effect. The code is not the problem, I
have replaced it with a simple message box pop-up but it still does not
work.. The code works fine when it is run directly after the workbook is open.

Cheers, Ozzy

"Norman Jones" wrote:

Hi Ozzy,

Perhaps Events have been turned off.

Goto the VBE (Alt-F11)
Select the Immediate window (Ctrl-G)
Type: Application.EnableEvents = True
Hit Enter
Try re-loading the problematic file.

If the problem subsists, post your code.

---
Regards,
Norman



"Ozzy" wrote in message
...
I cannot get my Workbook_Open() or Workbook_BeforeClose() macros to run
when
the workbook is opened. The macros work fine in any other workbooks, just
not this one ... Any ideas?

Using XL 2003





--

Dave Peterson

Ozzy

Workbook Open/BeforeClose Problem
 
I do Dave. I can get this functionality to work in any other workbook, but
just not this one !

Thanks, Ozzy

"Dave Peterson" wrote:

You do have those procedures in the ThisWorkbook module, right?

Ozzy wrote:

Good idea Norman, tried it but to no effect. The code is not the problem, I
have replaced it with a simple message box pop-up but it still does not
work.. The code works fine when it is run directly after the workbook is open.

Cheers, Ozzy

"Norman Jones" wrote:

Hi Ozzy,

Perhaps Events have been turned off.

Goto the VBE (Alt-F11)
Select the Immediate window (Ctrl-G)
Type: Application.EnableEvents = True
Hit Enter
Try re-loading the problematic file.

If the problem subsists, post your code.

---
Regards,
Norman



"Ozzy" wrote in message
...
I cannot get my Workbook_Open() or Workbook_BeforeClose() macros to run
when
the workbook is opened. The macros work fine in any other workbooks, just
not this one ... Any ideas?

Using XL 2003




--

Dave Peterson


Dave Peterson

Workbook Open/BeforeClose Problem
 
How are you opening the file?

If you have a macro in one workbook that opens this second workbook and that
macro is started by a shortcut key, remove the shift from that shortcut key
combination.



Ozzy wrote:

I do Dave. I can get this functionality to work in any other workbook, but
just not this one !

Thanks, Ozzy

"Dave Peterson" wrote:

You do have those procedures in the ThisWorkbook module, right?

Ozzy wrote:

Good idea Norman, tried it but to no effect. The code is not the problem, I
have replaced it with a simple message box pop-up but it still does not
work.. The code works fine when it is run directly after the workbook is open.

Cheers, Ozzy

"Norman Jones" wrote:

Hi Ozzy,

Perhaps Events have been turned off.

Goto the VBE (Alt-F11)
Select the Immediate window (Ctrl-G)
Type: Application.EnableEvents = True
Hit Enter
Try re-loading the problematic file.

If the problem subsists, post your code.

---
Regards,
Norman



"Ozzy" wrote in message
...
I cannot get my Workbook_Open() or Workbook_BeforeClose() macros to run
when
the workbook is opened. The macros work fine in any other workbooks, just
not this one ... Any ideas?

Using XL 2003




--

Dave Peterson


--

Dave Peterson

Ozzy

Workbook Open/BeforeClose Problem
 
Hi Dave,

Just a simple file open, not called from another macro

"Dave Peterson" wrote:

How are you opening the file?

If you have a macro in one workbook that opens this second workbook and that
macro is started by a shortcut key, remove the shift from that shortcut key
combination.



Ozzy wrote:

I do Dave. I can get this functionality to work in any other workbook, but
just not this one !

Thanks, Ozzy

"Dave Peterson" wrote:

You do have those procedures in the ThisWorkbook module, right?

Ozzy wrote:

Good idea Norman, tried it but to no effect. The code is not the problem, I
have replaced it with a simple message box pop-up but it still does not
work.. The code works fine when it is run directly after the workbook is open.

Cheers, Ozzy

"Norman Jones" wrote:

Hi Ozzy,

Perhaps Events have been turned off.

Goto the VBE (Alt-F11)
Select the Immediate window (Ctrl-G)
Type: Application.EnableEvents = True
Hit Enter
Try re-loading the problematic file.

If the problem subsists, post your code.

---
Regards,
Norman



"Ozzy" wrote in message
...
I cannot get my Workbook_Open() or Workbook_BeforeClose() macros to run
when
the workbook is opened. The macros work fine in any other workbooks, just
not this one ... Any ideas?

Using XL 2003




--

Dave Peterson


--

Dave Peterson


Dave Peterson

Workbook Open/BeforeClose Problem
 
How about replacing your workbook_open with:

sub workbook_open()
call Continue_open
end sub

and put Continue_Open in a general module.

======
Or just try auto_Open and auto_close.

I don't have any more guesses why it doesn't work for you.

Well, a couple more...

Are events enabled when you open that workbook?
Do you enable macros when that workbook opens?

===
If you add a line like:
msgbox "hi from workbook_open"
right at the top, do you see that message box?

If yes, maybe it's something in your code later on.

Ozzy wrote:

Hi Dave,

Just a simple file open, not called from another macro

"Dave Peterson" wrote:

How are you opening the file?

If you have a macro in one workbook that opens this second workbook and that
macro is started by a shortcut key, remove the shift from that shortcut key
combination.



Ozzy wrote:

I do Dave. I can get this functionality to work in any other workbook, but
just not this one !

Thanks, Ozzy

"Dave Peterson" wrote:

You do have those procedures in the ThisWorkbook module, right?

Ozzy wrote:

Good idea Norman, tried it but to no effect. The code is not the problem, I
have replaced it with a simple message box pop-up but it still does not
work.. The code works fine when it is run directly after the workbook is open.

Cheers, Ozzy

"Norman Jones" wrote:

Hi Ozzy,

Perhaps Events have been turned off.

Goto the VBE (Alt-F11)
Select the Immediate window (Ctrl-G)
Type: Application.EnableEvents = True
Hit Enter
Try re-loading the problematic file.

If the problem subsists, post your code.

---
Regards,
Norman



"Ozzy" wrote in message
...
I cannot get my Workbook_Open() or Workbook_BeforeClose() macros to run
when
the workbook is opened. The macros work fine in any other workbooks, just
not this one ... Any ideas?

Using XL 2003




--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


All times are GMT +1. The time now is 10:33 AM.

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