View Single Post
  #11   Report Post  
Posted to microsoft.public.excel.misc
andriil
 
Posts: n/a
Default Workbook_Open ()

I have a similar problem.
My Workbook_Open() event doesn't work whenever my workbook contains links to
some other workbook.
When I delete the link, everything seems to work fine.
I tried to replace Open event with Activate event. But I face the same
problem: although Activate event works fine when the workbook is open, update
links prompt seems to intercept it, so that the event is not triggered when
the workbook is opened.
I don't know how to do with it. Can anybody help?
Thanks a lot in advance!


"Dave Peterson" wrote:

If that workbook is already open and you use the list at the bottom of the File
dialog, then you're just activating the workbook (if it's not active).

Are you really doing File|Open?

Are you sure that the workbook was actually closed?

Bill Martin wrote:

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


--

Dave Peterson