Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 81
Default workbook specific custom toolbars

Excel 2003
I have 3 workbooks each having a specific custom toolbar associated with
it..
The toolbars are very different from each other.
The workbooks are all open and used together, the switching from one to
another -
when required - being achieved using "Window" in the menu bar.
When this is done, my code automatically selects the "incoming" workbook's
associated toolbar OK and closes that of the "outgoing" book.
However, if I CLOSE (and save) any one of the WBs, say#1,
I want the next WB that appears (it doesn't matter which of the 2 left, say
#3)
to appear with it's correct associated bar.
The problem is I can't find a trigger event associated with the appearance
of WB#3 when WB#1 closes, to trigger the appropriate selection code.

By selecting a WB from the menu "Window", Private Sub Workbook_Activate()
is triggered, but when a WB just appears, simply because another has been
closed,
it doesn't.

My optimism says there must be some way of catching this change,
but so far it's escaped me!
Help please
donwb


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,420
Default workbook specific custom toolbars

How about the Workbook_Activate event?

What event are you using to close the other toolbar?

--
__________________________________
HTH

Bob

"donwb" wrote in message
...
Excel 2003
I have 3 workbooks each having a specific custom toolbar associated with
it..
The toolbars are very different from each other.
The workbooks are all open and used together, the switching from one to
another -
when required - being achieved using "Window" in the menu bar.
When this is done, my code automatically selects the "incoming" workbook's
associated toolbar OK and closes that of the "outgoing" book.
However, if I CLOSE (and save) any one of the WBs, say#1,
I want the next WB that appears (it doesn't matter which of the 2 left,
say #3)
to appear with it's correct associated bar.
The problem is I can't find a trigger event associated with the appearance
of WB#3 when WB#1 closes, to trigger the appropriate selection code.

By selecting a WB from the menu "Window", Private Sub Workbook_Activate()
is triggered, but when a WB just appears, simply because another has been
closed,
it doesn't.

My optimism says there must be some way of catching this change,
but so far it's escaped me!
Help please
donwb



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 81
Default workbook specific custom toolbars

The Workbook_Activate event only seems to occur when I use menu "Window" to
select a WB.
I use that to show the appropriate TB and Workbook_Deactivate to close the
other TB.
These events don't seem to be triggered when a WB "appears" following the
CLOSURE
of another.


"Bob Phillips" wrote in message
...
How about the Workbook_Activate event?

What event are you using to close the other toolbar?

--
__________________________________
HTH

Bob

"donwb" wrote in message
...
Excel 2003
I have 3 workbooks each having a specific custom toolbar associated with
it..
The toolbars are very different from each other.
The workbooks are all open and used together, the switching from one to
another -
when required - being achieved using "Window" in the menu bar.
When this is done, my code automatically selects the "incoming"
workbook's
associated toolbar OK and closes that of the "outgoing" book.
However, if I CLOSE (and save) any one of the WBs, say#1,
I want the next WB that appears (it doesn't matter which of the 2 left,
say #3)
to appear with it's correct associated bar.
The problem is I can't find a trigger event associated with the
appearance
of WB#3 when WB#1 closes, to trigger the appropriate selection code.

By selecting a WB from the menu "Window", Private Sub Workbook_Activate()
is triggered, but when a WB just appears, simply because another has been
closed,
it doesn't.

My optimism says there must be some way of catching this change,
but so far it's escaped me!
Help please
donwb





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,420
Default workbook specific custom toolbars

This statement surprised me ... These events don't seem to be triggered
when a WB "appears" following the CLOSURE of another... so I tried it, and
it triggered Activate for me.


--
__________________________________
HTH

Bob

"donwb" wrote in message
...
The Workbook_Activate event only seems to occur when I use menu "Window"
to select a WB.
I use that to show the appropriate TB and Workbook_Deactivate to close the
other TB.
These events don't seem to be triggered when a WB "appears" following the
CLOSURE
of another.


"Bob Phillips" wrote in message
...
How about the Workbook_Activate event?

What event are you using to close the other toolbar?

--
__________________________________
HTH

Bob

"donwb" wrote in message
...
Excel 2003
I have 3 workbooks each having a specific custom toolbar associated with
it..
The toolbars are very different from each other.
The workbooks are all open and used together, the switching from one to
another -
when required - being achieved using "Window" in the menu bar.
When this is done, my code automatically selects the "incoming"
workbook's
associated toolbar OK and closes that of the "outgoing" book.
However, if I CLOSE (and save) any one of the WBs, say#1,
I want the next WB that appears (it doesn't matter which of the 2 left,
say #3)
to appear with it's correct associated bar.
The problem is I can't find a trigger event associated with the
appearance
of WB#3 when WB#1 closes, to trigger the appropriate selection code.

By selecting a WB from the menu "Window", Private Sub
Workbook_Activate()
is triggered, but when a WB just appears, simply because another has
been closed,
it doesn't.

My optimism says there must be some way of catching this change,
but so far it's escaped me!
Help please
donwb







  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 81
Default workbook specific custom toolbars

Hi Bob

By way of a simple test, I created two WBs, Test1 & Test2.
Test1 has the code:-
Sub MyClose()
ThisWorkbook.Close SaveChanges:=False
End Sub
located in "ThisWorkbook"

Test2 has the code:-
Private Sub Workbook_Activate()
MsgBox "I'm activated"
End Sub
also located in "ThisWorkbook"

With both WBs open, if I run the code in Test1 to close it
an error message appears:-
"Application-defined or object-defined error",
WB1 closes, but the MsgBox never appears.

However, if I close WB1 using instead the menu bar user interface
File/Close,
Activate is triggered and the MsgBox appears.

I want to do the closing programmatically so I'm still stuck.
donwb







"Bob Phillips" wrote in message
...
This statement surprised me ... These events don't seem to be triggered
when a WB "appears" following the CLOSURE of another... so I tried it, and
it triggered Activate for me.


--
__________________________________
HTH

Bob

"donwb" wrote in message
...
The Workbook_Activate event only seems to occur when I use menu "Window"
to select a WB.
I use that to show the appropriate TB and Workbook_Deactivate to close
the other TB.
These events don't seem to be triggered when a WB "appears" following the
CLOSURE
of another.


"Bob Phillips" wrote in message
...
How about the Workbook_Activate event?

What event are you using to close the other toolbar?

--
__________________________________
HTH

Bob

"donwb" wrote in message
...
Excel 2003
I have 3 workbooks each having a specific custom toolbar associated
with it..
The toolbars are very different from each other.
The workbooks are all open and used together, the switching from one to
another -
when required - being achieved using "Window" in the menu bar.
When this is done, my code automatically selects the "incoming"
workbook's
associated toolbar OK and closes that of the "outgoing" book.
However, if I CLOSE (and save) any one of the WBs, say#1,
I want the next WB that appears (it doesn't matter which of the 2 left,
say #3)
to appear with it's correct associated bar.
The problem is I can't find a trigger event associated with the
appearance
of WB#3 when WB#1 closes, to trigger the appropriate selection code.

By selecting a WB from the menu "Window", Private Sub
Workbook_Activate()
is triggered, but when a WB just appears, simply because another has
been closed,
it doesn't.

My optimism says there must be some way of catching this change,
but so far it's escaped me!
Help please
donwb









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
Before Workbook Event, Custom Calculate a Specific Worksheet jeffbert Excel Programming 6 July 14th 08 05:17 PM
custom view to display specific toolbars pwrichcreek Excel Programming 6 December 13th 07 10:50 PM
Custom toolbars for specific files Coolboy55 Excel Programming 1 March 14th 06 09:36 PM
Custom Menu Item specific to a workbook Tommy T Excel Programming 1 January 23rd 04 07:34 PM


All times are GMT +1. The time now is 02:32 PM.

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

About Us

"It's about Microsoft Excel"