Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 284
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default 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
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
VBA commands Love2Learn Excel Discussion (Misc queries) 4 January 28th 09 07:31 AM
DDE Commands Newby Excel Programming 2 October 17th 05 08:38 PM
DDE Commands Newby Excel Discussion (Misc queries) 0 October 17th 05 07:22 PM
DOS commands Taikoubo Excel Discussion (Misc queries) 0 March 30th 05 03:37 AM
MS DOS Commands nath Excel Programming 1 June 9th 04 02:22 PM


All times are GMT +1. The time now is 03:45 AM.

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"