Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Ping via VBA
Hi
Is it possible to ping a range of local IP addresses in VBA code by looping through the range using variables to produce a text file which includes the results? The range I want to ping is 192.168.0.0 to 192.168.255.255 I can create the nested loop command structure to increment the variables but can't pass them to the ping command. Extract of the code: Option Explicit Dim a,b,c,d,y,z For y = 0 To 255 For z = 0 To 255 Let a = 192 Let b = 0 Let c = y Let d = z Shell ("cmd /c ping a.b.c.d c:\ping.txt") Next z Next y This results in the following message being pasted to ping.txt: "Ping request could not find host a.b.c.d. Please check the name and try again" from which I assume the contents of the variables are not being passed into the shell command. Assuming the variables can be passed to the ping command, is it then possible to append the results of each loop to the text file instead of over writing it's contents? The reason I want to do this is that I have a printer with a NIC that I want to connect to my router and I think the printer has a fixed IP address but I can't communicate with it and don't want to spend eternity manually pinging all the addresses in the range until I hit the right one! Unfortunately I don't have the manual for the NIC and the Kyocera website isn't much help (not even sure the NIC card is a Kyocera). Any suggestions appreciated. Thanks Garry Douglas |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Ping a Set of IPs | Excel Programming | |||
Ping from Excel - Almost there | Excel Programming | |||
PING Bob Phillips | Excel Discussion (Misc queries) | |||
ping in excel | Excel Programming | |||
Ping anybody | Excel Programming |