Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hide Command Shell window
Hi Folks,
I'm trying to use the following VBA code to verify a list of server's DNS record. Although the results are correct, the command shell window always appears. Is any way to completely hide it? TIA. Corey Code: Function MyNslookupExe(ByRef fstrFQDN As String, ByRef fstrRealIP As String, fstrCmd As String) ' The function is to receive nslookup result. Dim WSH, wExec Dim Result As String Dim tmp fstrFQDN = "" fstrRealIP = "" Set WSH = CreateObject("WScript.Shell") Set wExec = WSH.Exec(fstrCmd) Result = wExec.StdOut.ReadAll tmp = Split(Result, vbCrLf) If tmp(3) < "" And Left(tmp(3), 4) = strName Then fstrFQDN = LCase(Trim(Right(tmp(3), Len(tmp(3)) - Len(strName) - 1))) fstrRealIP = LCase(Trim(Right(tmp(4), Len(tmp(4)) - Len(strAddress) - 1))) End If Set wExec = Nothing Set WSH = Nothing End Function |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I hide a shell command called from VBA in Excel | Excel Programming | |||
Shell Command | Excel Programming | |||
Place a SHELL Window | Excel Programming | |||
Shell command | Excel Programming | |||
Closing DOS window after shell command | Excel Programming |