Link to home
Start Free TrialLog in
Avatar of smithmrk
smithmrkFlag for United States of America

asked on

ShellExecute Hide Form and Wait

Hello all!

I have a form in which I call a program using ShellExecute (Does not work with using the Shell Command).

What I want to do is call the program and hide my current form while I'm using the program called by ShellExecute and once I'm done and exit the program I want my orginal form that placed the call to reapear for use.

How can I accomphlish this?

Thanks,
smithmrk
Avatar of jimbobmcgee
jimbobmcgee
Flag of United Kingdom of Great Britain and Northern Ireland image

Try using the Windows Scripting Host instead:

    Sub TryMe

        Set WSHShell = WScript.CreateObject("WScript.Shell")

        Form1.Hide
        WSHShell.Run "notepad.exe", 1, true
        Form1.Show

        Set WSHShell = Nothing

    End Sub

HTH

J.
ASKER CERTIFIED SOLUTION
Avatar of PaulHews
PaulHews
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of smithmrk

ASKER

That is exactly what I was looking for!

Thanks so much.  You guys are great!

Smithmrk