?
Solved

Excel VBS ping Question

Posted on 2012-08-20
8
Medium Priority
?
685 Views
Last Modified: 2012-08-23
I am looking to put a button on an excel sheet and have a script of some sort to ping addresses in column D and in Column E whether the ping was successfull or not.  Is this possible in excel?
0
Comment
Question by:jkemp761
  • 3
  • 3
  • 2
8 Comments
 
LVL 9

Expert Comment

by:WebDevEM
ID: 38312845
There's a good start to this at http://forums.devshed.com/visual-basic-programming-52/ping-from-vba-328706.html that can give you an idea... Look for post # 13 from GammaRay.  You'd need to create a loop to go through all the rows in Column D with values, run that function and populate the cell 1 to the right.  I'm super busy today but if nobody comes back with a more complete answer I can try to write one up.
0
 
LVL 24

Expert Comment

by:Steve
ID: 38312884
Attached is a file with code.

Is this somewhere near?
Ping-IP.xlsm
0
 
LVL 9

Expert Comment

by:WebDevEM
ID: 38312952
Well done!  

Using that as a framework, you can do quite a bit to make it fancier if you need... change the color of Cells(x, 5) based on success/fail maybe, just to make it easier to read at a glance.  Maybe make Cells(x,6) the response time, and add a status as it's searching.  Something like this:
 'Address to ping
    strIPAddress = Cells(x, 4)
    Cells(x, 5) = "... testing"

Open in new window

so you know where it is in the list, and if it runs into problems you'll know
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 24

Expert Comment

by:Steve
ID: 38313164
If you wish to ping site address such as Google.com see attached:
Ping-IP.xlsm
0
 

Author Comment

by:jkemp761
ID: 38313253
Nicely Done Barman! And will accept as solution, One question though, how do I make it skip the first row so I can label the E Column?  

Thanks!
0
 
LVL 24

Accepted Solution

by:
Steve earned 800 total points
ID: 38313294
In both bits of code it uses:

For x = 1 To ActiveSheet.UsedRange.Rows.Count

just change the x = 1 to x = 2 for starting at the second row :)
0
 

Author Comment

by:jkemp761
ID: 38313515
Im Accepting this solution and posting another question as I want to expand on this but want to give you credit for what you have already done.
0
 

Author Closing Comment

by:jkemp761
ID: 38313517
The solution provided by Barman has worked flawlessly...
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question