Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
External Commands?
Hi,
This is probably beyond what an Excel Macro can do but I thought I'd ask anyhow. Using Excel 2003, is it possible to run windows commands from within Excel and return the results to a spreadsheet? What I'm trying to do is ping a range of IP addresses, 192.168.1.1 - 192.168.1.100, and return the results to a worksheet so I can see what IP addresses are already assigned on my network and what they are assigned to. My predesesor didn't bother to keep a list of used IP addresses. Thanks in advance, Linn |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
External Commands?
You should be able to adapt any of these to VBA (0r most of them)
http://vbnet.mvps.org/code/internet/index.html Randy Birch's site Look down the list to see code related to PING. -- Regards, Tom Ogilvy "Linn Kubler" wrote: Hi, This is probably beyond what an Excel Macro can do but I thought I'd ask anyhow. Using Excel 2003, is it possible to run windows commands from within Excel and return the results to a spreadsheet? What I'm trying to do is ping a range of IP addresses, 192.168.1.1 - 192.168.1.100, and return the results to a worksheet so I can see what IP addresses are already assigned on my network and what they are assigned to. My predesesor didn't bother to keep a list of used IP addresses. Thanks in advance, Linn |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
External Commands?
You could modify something like this to run through the range rather than
just pull the results for one IP as this example does. Sub PingAnIP() Dim R As Integer Dim strIP As String R = 1 strIP = "192.168.1.1" Set objShell = CreateObject("WScript.Shell") Set objExecPing = objShell.Exec("Ping " & strIP) Set objPingOutput = objExecPing.StdOut Do Until objPingOutput.AtEndOfStream strLine = objPingOutput.ReadLine If Len(strLine) 2 Then Cells(R, 1).Value = strLine R = R + 1 End If Loop End Sub Steve "Linn Kubler" wrote in message ... Hi, This is probably beyond what an Excel Macro can do but I thought I'd ask anyhow. Using Excel 2003, is it possible to run windows commands from within Excel and return the results to a spreadsheet? What I'm trying to do is ping a range of IP addresses, 192.168.1.1 - 192.168.1.100, and return the results to a worksheet so I can see what IP addresses are already assigned on my network and what they are assigned to. My predesesor didn't bother to keep a list of used IP addresses. Thanks in advance, Linn |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
External Commands?
Thanks Tom, I'm worried that adapting something like this for VBA is a bit
involved for my skill set right now but I'll give it a wirl. Looks like a number of handy functions on that site. Linn "Tom Ogilvy" wrote in message ... You should be able to adapt any of these to VBA (0r most of them) http://vbnet.mvps.org/code/internet/index.html Randy Birch's site Look down the list to see code related to PING. -- Regards, Tom Ogilvy "Linn Kubler" wrote: Hi, This is probably beyond what an Excel Macro can do but I thought I'd ask anyhow. Using Excel 2003, is it possible to run windows commands from within Excel and return the results to a spreadsheet? What I'm trying to do is ping a range of IP addresses, 192.168.1.1 - 192.168.1.100, and return the results to a worksheet so I can see what IP addresses are already assigned on my network and what they are assigned to. My predesesor didn't bother to keep a list of used IP addresses. Thanks in advance, Linn |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
VBA commands | Excel Discussion (Misc queries) | |||
DDE Commands | Excel Programming | |||
DDE Commands | Excel Discussion (Misc queries) | |||
DOS commands | Excel Discussion (Misc queries) | |||
MS DOS Commands | Excel Programming |