Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to hide a shell?

Status
Not open for further replies.
Oct 22, 2001
215
US
Hi,
Finally I got a way to create a shell and wait till it finish it's work. This call a windows program. My problem is, while this Shell is runing I don't want it to appear on my screen... another word I want to hide. This is my code:

Function ShellAndWait(FileName As String, y As String)
Dim objScript, Progress
On Error GoTo ERR_OpenForEdit
Set objScript = CreateObject("Wscript.shell")
shellapp = objScript.Run(FileName, 1, True)
ShellAndWait = True
EXIT_OpenForEdit:
Exit Function
ERR_OpenForEdit:
MsgBox Err.Description
GoTo EXIT_OpenForEdit
End Function

I know there is property like vbHide but it does not accept ..? What am I doing wrong?
 
I think, that because you are using the run method rather than the Shell function. The Shell function supports the vbHide windowmode you referred to. From what I saw in the help file, the Run method does not support this.

However, are you opening some kind of batch file or other program? If this is the case, you can actually its properties to run minimized. This might accomplish what you need, but I am less than certain :)

James Goodman
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top