Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Worksheet_Activate Not Called When Opening Workbook

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Worksheet_Activate Not Called When Opening Workbook

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.

--

HTH

RP

"Gaston" wrote in message
...
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.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default Worksheet_Activate Not Called When Opening Workbook

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

"Gaston" wrote in message
...
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.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default Worksheet_Activate Not Called When Opening Workbook

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


"Bob Phillips" wrote in message
...
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.

--

HTH

RP

"Gaston" wrote in message
...
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.





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 170
Default Worksheet_Activate Not Called When Opening Workbook

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,
--
George Nicholson

Remove 'Junk' from return address.


"Gaston" wrote in message
...
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.





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Worksheet_Activate Not Called When Opening Workbook

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

"Doug Glancy" wrote in message
...
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


"Bob Phillips" wrote in message
...
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.

--

HTH

RP

"Gaston" wrote in message
...
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.







  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Worksheet_Activate Not Called When Opening Workbook

Thanks. This was the answer.


Gaston

"George Nicholson" wrote:

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,
--
George Nicholson

Remove 'Junk' from return address.


"Gaston" wrote in message
...
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.




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
SIZE Window, Tile, Worksheet, Workbook, Whatever it's called. JamesInNeedFootballInDeed New Users to Excel 4 October 31st 07 11:16 PM
When I open a workbook, another one called Book1 is also opened. W Ian@MarlandLtd Excel Discussion (Misc queries) 2 November 9th 05 09:36 AM
why is an Excel file called a workbook? Monique Excel Discussion (Misc queries) 3 October 14th 05 05:52 PM
Opening a UserForm causes a crash in the Exit procedure (Which is never called) Brent McIntyre Excel Programming 0 May 12th 04 12:37 PM
how to make subs/procs can only be called from within the workbook they belong to? Arnoud Oortwijk Excel Programming 2 September 27th 03 03:43 AM


All times are GMT +1. The time now is 11:52 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"