Worksheet_Activate Not Called When Opening Workbook

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm using code in the Worksheet_Activate event to load a Menu. This works
fine when manually switching from one worksheet to another. However, when
the workbook is first opened, this event is not issued for the active sheet.
How can I get this event to run when the workbook is first opened. The
active sheet can be any sheet that the user had activated prior to the last
worbook close.
 
You could either add it to the workbook_open event (but what happens if the
activesheet is some other?), or maybe check in workbook_open if that sheet
is active and then load it.
 
Gaston,

Use the WorkBook_Open event and check the Activesheet. If it's the one(s)
that uses the toolbar then run your toolbar load code.

hth,

Doug Glancy
 
Bob,

I was wondering, are you no longer "looking out across Poole Harbour to the
Purbecks?" At one point I Googled it and it looks like a beautiful part of
the planet. I had also thought of signing myself as "looking across my
stomach tomy toes" - my relaxed laptop position - but wasn't sure if you
would appreciate the attempt at humor.

Doug Glancy
 
One way: Change the Worksheet_Activate event from Private to Public, then
add the following to ThisWorkbook module:

Private Workbook_Open()
Worksheets("MySheet").Worksheet_Activate
End Sub

HTH,
 
Hi Doug,

With the weather that we are having at the moment, I can hardly the harbour,
never mind across it. From work, high on the 5th floor I can usually glimpse
them at the moment.

That signature was inspired by a guy in the travel groups who signed himself
as looking out across one of the lakes in the lake district (Windermere
IIRC), and I thought, this is a lovely place as well, a bit more built-up
perhaps, but really nice, so I penned mine. I also recall many other
humorous ripostes to that one, such as 'looking down my garden to the
British Rail woolshed's, et al.

A change from the Zen mantras I fell<vbg>.

Bob
 
Thanks. This was the answer.


Gaston

George Nicholson said:
One way: Change the Worksheet_Activate event from Private to Public, then
add the following to ThisWorkbook module:

Private Workbook_Open()
Worksheets("MySheet").Worksheet_Activate
End Sub

HTH,
 
Back
Top