Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Ping from Excel - Almost there | Excel Programming | |||
PING within Excel Cell | Excel Worksheet Functions | |||
Excel Ping Command..via web... | Excel Programming | |||
Ping results into Excel | Excel Programming | |||
ping in excel | Excel Programming |