Return focus

User avatar
VegasNath
5StarLounger
Posts: 1185
Joined: 24 Jan 2010, 12:02
Location: Wales, UK.

Return focus

Post by VegasNath »

Hello,

I am using the following to execute a .bat from excel.

Code: Select all

RetVal = Shell("C:\Daily Run.bat", 1)
How can I return focus back to excel once the .bat execution commences?

TIA
:wales: Nathan :uk:
There's no place like home.....

User avatar
HansV
Administrator
Posts: 78545
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Return focus

Post by HansV »

What happens if you use

RetVal = Shell("C:\Daily Run.bat", vbHide)

or

RetVal = Shell("C:\Daily Run.bat", vbNormalNoFocus)
Best wishes,
Hans

User avatar
VegasNath
5StarLounger
Posts: 1185
Joined: 24 Jan 2010, 12:02
Location: Wales, UK.

Re: Return focus

Post by VegasNath »

I'll try tomorrow and report back. :cheers:
:wales: Nathan :uk:
There's no place like home.....