Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 661
Default Deactivate Code

I have a model which allows users to select a range of items to print, and it
can be used from a variety of other model sources.

When it is used it displays the list, allows them to select, then has two
buttons - one to process and one to exit.

However, if they simply activate another workbook the process becomes lost.

What I want to do is place some code in the WorkbookDeactivate event that
will ask whether this is what they want to do, then return without
deactivating the selection model if they select that option. A messagebox in
the deactivate code gives me the response, but how do I pass the user back to
the workbook they have just tried to deactivate ?

(Sorry for the long-winded explanation)
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Deactivate Code

I think you are over complicating the problem. ThisWorkbook needs to be
added to your code which will return the code to the workbook where the code
is executing rather than any other workbook. The default window is the
active window which is the newly opened workbook. Simply adding
Thisworkbook.Activate should solve the problem.

"Paul" wrote:

I have a model which allows users to select a range of items to print, and it
can be used from a variety of other model sources.

When it is used it displays the list, allows them to select, then has two
buttons - one to process and one to exit.

However, if they simply activate another workbook the process becomes lost.

What I want to do is place some code in the WorkbookDeactivate event that
will ask whether this is what they want to do, then return without
deactivating the selection model if they select that option. A messagebox in
the deactivate code gives me the response, but how do I pass the user back to
the workbook they have just tried to deactivate ?

(Sorry for the long-winded explanation)

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 661
Default Deactivate Code

As always the simplest answers are the best.

Many thanks

"Joel" wrote:

I think you are over complicating the problem. ThisWorkbook needs to be
added to your code which will return the code to the workbook where the code
is executing rather than any other workbook. The default window is the
active window which is the newly opened workbook. Simply adding
Thisworkbook.Activate should solve the problem.

"Paul" wrote:

I have a model which allows users to select a range of items to print, and it
can be used from a variety of other model sources.

When it is used it displays the list, allows them to select, then has two
buttons - one to process and one to exit.

However, if they simply activate another workbook the process becomes lost.

What I want to do is place some code in the WorkbookDeactivate event that
will ask whether this is what they want to do, then return without
deactivating the selection model if they select that option. A messagebox in
the deactivate code gives me the response, but how do I pass the user back to
the workbook they have just tried to deactivate ?

(Sorry for the long-winded explanation)

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
Deactivate Save As Alex.W Excel Discussion (Misc queries) 5 June 21st 07 11:58 AM
Deactivate worksheet Cordobes Excel Discussion (Misc queries) 3 December 4th 05 10:16 AM
Worksheet Deactivate Graham Haughs Excel Programming 4 July 29th 05 06:02 PM
Workbook Deactivate incjourn[_4_] Excel Programming 1 September 14th 04 02:51 PM
Deactivate Formula DME Excel Programming 2 February 11th 04 09:00 PM


All times are GMT +1. The time now is 09:48 PM.

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"