Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Guys,
This function returns the ping resolve time. Function xlPing(strHost As String) 'Ping a host to see if it is alive Dim objPing Dim objRetStatus Dim strMessage If strHost = "" Then xlPing = False 'MsgBox "No host defined", vbCritical, "Whoops" Else Set objPing = GetObject("winmgmts: {impersonationLevel=impersonate}").ExecQuery("sele ct * from Win32_PingStatus where address = '" & strHost & "'") For Each objRetStatus In objPing If IsNull(objRetStatus.StatusCode) Or objRetStatus.StatusCode < 0 Then xlPing = False Else xlPing = objRetStatus.ResponseTime End If Next End If Set objPing = Nothing Set objRetStatus = Nothing End Function |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Ping via VBA | Excel Programming | |||
Ping a Set of IPs | Excel Programming | |||
PING Bob Phillips | Excel Discussion (Misc queries) | |||
ping in excel | Excel Programming | |||
Ping anybody | Excel Programming |