Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 133
Default switching out of Excel with userform open

I have a userform that remains open as a tool to the user and gives them the
choice of leaving the focus on it or the active workbook. If the form
happens to have the focus when I Alt-Tab to another application (e.g.
Outlook), alt-tabbing back shows me the userform but not Excel, that is, the
userform floats on its own above Outlook and I can't see Excel.

Any ideas how to deal with this? It can be resolved by clicking a couple of
times on the Excel icon in the taskbar but I like Alt-Tab and I know other
people who'll be using this are the same!

I guess an approach would be to find an Excel-loses-focus event and use this
to run AppActivate Application.Caption or some such to move the focus back to
Excel just before switching to the other application but I haven't found this.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default switching out of Excel with userform open

Use the SetWindowLong API as explained he

http://www.cpearson.com/excel/SetParent.htm

RBS


"Smallweed" wrote in message
...
I have a userform that remains open as a tool to the user and gives them
the
choice of leaving the focus on it or the active workbook. If the form
happens to have the focus when I Alt-Tab to another application (e.g.
Outlook), alt-tabbing back shows me the userform but not Excel, that is,
the
userform floats on its own above Outlook and I can't see Excel.

Any ideas how to deal with this? It can be resolved by clicking a couple
of
times on the Excel icon in the taskbar but I like Alt-Tab and I know other
people who'll be using this are the same!

I guess an approach would be to find an Excel-loses-focus event and use
this
to run AppActivate Application.Caption or some such to move the focus back
to
Excel just before switching to the other application but I haven't found
this.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 133
Default switching out of Excel with userform open

Thanks for that - interesting code! I seem to get a problem with it that
Excel now completely vanishes off the Alt-Tab list.

"RB Smissaert" wrote:

Use the SetWindowLong API as explained he

http://www.cpearson.com/excel/SetParent.htm

RBS


"Smallweed" wrote in message
...
I have a userform that remains open as a tool to the user and gives them
the
choice of leaving the focus on it or the active workbook. If the form
happens to have the focus when I Alt-Tab to another application (e.g.
Outlook), alt-tabbing back shows me the userform but not Excel, that is,
the
userform floats on its own above Outlook and I can't see Excel.

Any ideas how to deal with this? It can be resolved by clicking a couple
of
times on the Excel icon in the taskbar but I like Alt-Tab and I know other
people who'll be using this are the same!

I guess an approach would be to find an Excel-loses-focus event and use
this
to run AppActivate Application.Caption or some such to move the focus back
to
Excel just before switching to the other application but I haven't found
this.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default switching out of Excel with userform open

You probably coded something wrong.
Post your code and we will see.

RBS

"Smallweed" wrote in message
...
Thanks for that - interesting code! I seem to get a problem with it that
Excel now completely vanishes off the Alt-Tab list.

"RB Smissaert" wrote:

Use the SetWindowLong API as explained he

http://www.cpearson.com/excel/SetParent.htm

RBS


"Smallweed" wrote in message
...
I have a userform that remains open as a tool to the user and gives them
the
choice of leaving the focus on it or the active workbook. If the form
happens to have the focus when I Alt-Tab to another application (e.g.
Outlook), alt-tabbing back shows me the userform but not Excel, that
is,
the
userform floats on its own above Outlook and I can't see Excel.

Any ideas how to deal with this? It can be resolved by clicking a
couple
of
times on the Excel icon in the taskbar but I like Alt-Tab and I know
other
people who'll be using this are the same!

I guess an approach would be to find an Excel-loses-focus event and use
this
to run AppActivate Application.Caption or some such to move the focus
back
to
Excel just before switching to the other application but I haven't
found
this.




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
How do you make a userform open automatically when you open excel? Evan Excel Worksheet Functions 1 March 11th 10 02:24 AM
Userform Commands - Switching Question pallaver Excel Discussion (Misc queries) 1 August 1st 08 02:03 AM
Unload/Hide Userform when switching to a new Wbk avi Excel Programming 1 March 14th 07 08:25 PM
Always open Excel file with Userform Santhosh Mani[_2_] Excel Programming 2 April 6th 05 08:53 AM
Switching from InputBox to UserForm? Sean Stuber Excel Programming 4 April 19th 04 03:35 PM


All times are GMT +1. The time now is 12:08 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"