ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Passing focus to another application (https://www.excelbanter.com/excel-programming/371641-passing-focus-another-application.html)

fred

Passing focus to another application
 
If shell out to another application how can I pass the focus to that
application.
When I run:

Shell "notepad.exe C:\Temp\MyFile.txt"

it starts notepad OK but the focus remains with excel. I want the focus to
goto notepad.

Thanks for any help
Fred



NickHK[_3_]

Passing focus to another application
 
Fred,
Look at the 2nd argument to Shell.
Possibly you want "vbNormalFocus"

NickHK

"Fred" <leavemealone@home l...
If shell out to another application how can I pass the focus to that
application.
When I run:

Shell "notepad.exe C:\Temp\MyFile.txt"

it starts notepad OK but the focus remains with excel. I want the focus to
goto notepad.

Thanks for any help
Fred





[email protected]

Passing focus to another application
 
hey

Shell "c:\windows\notepad.exe", 1

will activate your window
here is another states
0 - hide
1 - normal
2 - minimized
3 - maximized
4 - normal size but not focused
5 - minimized and not focused

i hope i have answered your question



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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com