Ping in Excel and want to add DNS lookup

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

vineet9singh

Thread Starter
Joined
Jun 25, 2018
Messages
1
Dear Sir,

I want to add one more column for DNS lookup in below mention code:

Sub ClearValues()
'ResetValues
Rows("4:5124").Select
Selection.ClearContents
Rows("4:4").Select
End Sub
Sub RunPing()
i = 4
While (ActiveSheet.Cells(i, 1) <> "")
'Retrieve IP Address
strCompAddress = ActiveSheet.Cells(i, 1)

'//Setup Shell command for Ping
'//NOTE: Make to leave a space after PING.exe
Dim strShellCommand As String
strShellCommand = "C:\Windows\System32\PING.exe " + strCompAddress

'//Create Shell Object in to run Scripts
Set oSh = CreateObject("WScript.Shell")
Set oEx = oSh.Exec(strShellCommand)

'//Read output buffer
strBuf = oEx.StdOut.ReadAll
ActiveSheet.Cells(i, 2) = strBuf
i = i + 1
Wend
End Sub
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top