Hi Bill,
Changing the code doesn't count. I did a Copy/Paste to put the code here
The spelling error was the only thing that suggested itself.
I'm sort of presuming (hoping?) that somewhere is a security feature of
Excel that allows you to turn off the automatic Workbook_Open event, and
which I've inadvertently set or some such.
I am not aware of any such switch / feature.
Incidentally, can you tell me what version of Excel you tested it with?
xl2k
---
Regards,
Norman
"Bill Martin" wrote in message
...
Changing the code doesn't count. I did a Copy/Paste to put the code here
so that I'd know it was precisely what was in the VBA. I also allowed VBE
to insert the code itself from a menu once rather than me typing it in. I
got the same code and the same problem. Not an error statement of any
kind -- it just doesn't execute.
I'm sort of presuming (hoping?) that somewhere is a security feature of
Excel that allows you to turn off the automatic Workbook_Open event, and
which I've inadvertently set or some such.
Incidentally, can you tell me what version of Excel you tested it with?
Thanks...
Bill
-------------------------
Norman Jones wrote:
Hi Bill,
You code worked for me 'as is'.
If, however, I introduced a minor spelling error, I could replicate your
experience, e.g.:
Private Sub Workbbook_Open()
MsgBox "Workbook_Open Called"
Call AddButtons
End Sub
---
Regards,
Norman
"Bill Martin" wrote in message
...
I'm using Excel97 and have trouble with Workbook_Open().
Within the module "ThisWorkbook" I have the following three event handler
calls:
Option Explicit
Private Sub Workbook_Activate()
Call AddButtons
End Sub
Private Sub Workbook_Deactivate()
Call DeleteButtons
End Sub
Private Sub Workbook_Open()
MsgBox "Workbook_Open Called"
Call AddButtons
End Sub
The Activate and Deactivate events work properly. If I have multiple
workbooks open, whenever this particular workbook is selected from the
Window menu, the code is called and executes as one would expect.
The Workbook_Open event never seems to get called. I open Excel, and
then from the File menu open this workbook, but the code never gets
called. Originally it did not have the MsgBox statement, but I added that
for debug and it never gets called either.
Am I doing something wrong? Is this a known bug in Excel97? It seems
like I've reduced the problem to such a simple example that it *must*
work, but it doesn't.
Thanks...
Bill
|