Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default retrieve ping status in ms excel

I want to ping a IP list in excel and add the ping status to the column on
the right next to the ip adres?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 180
Default retrieve ping status in ms excel

I am sure you will have to use API function call for this. The below might help

http://support.microsoft.com/default.aspx/kb/223025
http://ostrosoft.com/vb/projects/ipconfig.asp
http://www.codeproject.com/internet/netcfg.asp


HTH,
--
Pranav Vaidya
VBA Developer
PN, MH-India
If you think my answer is useful, please rate this post as an ANSWER!!


"Lookup value with coding" wrote:

I want to ping a IP list in excel and add the ping status to the column on
the right next to the ip adres?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 131
Default retrieve ping status in ms excel

"Lookup value with coding" wrote:

I want to ping a IP list in excel and add the ping status to the column on
the right next to the ip adres?


If you are using Windows XP, there is a WMI Win32_PingStatus class (you need
administrator privileges to run this):

Function Ping1(Host As String) As Boolean

Ping1 = False

Set objPing = GetObject _
("WinMgmts:{impersonationLevel=impersonate}"). _
ExecQuery("Select * From Win32_PingStatus " & _
"Where Address = '" & Host & "'")

For Each objStatus In objPing
If IsNull(objStatus.StatusCode) _
Or objStatus.StatusCode < 0 Then
Ping1 = False
Else
Ping1 = True
End If
Next

Set objPing = Nothing

End Function


Also, you can use WshShell.Exec function to run Ping command and check the
output:

Function Ping2(Host As String) As Boolean

Ping2 = False

Status = CreateObject("WScript.Shell"). _
Exec("Ping " & Host).StdOut.ReadAll

If InStr(Status, "Received = 0") = 0 Then
Ping2 = True
Else
Ping2 = False
End If

End Function

You can modify this to accept optional Ping arguments (like -n or -w etc).

Hope this helps.


--
urkec
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
Ping from Excel - Almost there RRohl Excel Programming 3 August 22nd 06 07:26 AM
PING within Excel Cell Steve Excel Worksheet Functions 1 July 14th 06 02:58 PM
Excel Ping Command..via web... HickoryShade[_4_] Excel Programming 6 December 13th 05 03:30 PM
Ping results into Excel RB Smissaert Excel Programming 0 February 24th 05 03:00 PM
ping in excel Andy Mohan Excel Programming 5 February 21st 05 10:08 PM


All times are GMT +1. The time now is 02:03 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"