Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
BeforeClose Problem | Excel Programming | |||
problem with beforeclose event | Excel Programming | |||
Workbook BeforeClose Bug | Excel Programming | |||
How to keep spreadsheet open in the BeforeClose event | Excel Programming | |||
Excel - BeforeClose Problem... | Excel Programming |