Deactivate Code

P

Paul

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)
 
J

Joel

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top