Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I hide a shell command called from VBA in Excel Robert Lyriotakis Excel Programming 2 December 8th 04 02:25 PM
Shell Command JOHN Excel Programming 1 November 17th 04 10:39 AM
Place a SHELL Window Robin Clay[_3_] Excel Programming 3 August 13th 04 12:35 AM
Shell command MAx Excel Programming 2 June 4th 04 04:11 PM
Closing DOS window after shell command Garry Boswell Excel Programming 1 January 9th 04 10:32 PM


All times are GMT +1. The time now is 05:08 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"