+ Reply to Thread
Results 1 to 6 of 6

Ping Timeout Causing Application Hang

  1. #1
    Registered User
    Join Date
    12-03-2015
    Location
    San Jose, California
    MS-Off Ver
    2010
    Posts
    4

    Question Ping Timeout Causing Application Hang

    Good morning everybody! I've been using this piece of code to run a ping on a column of IP adresses and color the cells either green or red depending on the results. It works fine when I step through it using F8, however when it gets to an address that times out, it hangs the whole program for almost a full minute until it gets a result. Since this happens, when I try to run the script as intended, it hangs when it gets a timeout and does not recover. What I would like to do (or at least find out if it is possible or not) is a way to add a timer or adjust the timeout rate so it doesn't hang for so long. I will freely admit, I know very little about VBA scripting. Everything I know about VBA script, I have learned from trying to solve this problem. I've been searching all over for a solution to this and everything I find is either relatively complicated, or doesn't quite apply to what I'm trying to do. For reference, I am pinging printers on a network just to check connection status, and I would like to be able to send this spreadsheet to people and have them be able to run it without having to create additional files or anything too complicated. Is this possible or am I over-reaching on the capabilities of VBA?

    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    12-03-2015
    Location
    San Jose, California
    MS-Off Ver
    2010
    Posts
    4

    Re: Ping Timeout Causing Application Hang

    Bump no response.

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Ping Timeout Causing Application Hang

    Hello broc5k,

    What ping metrics are you looking for or really need? I am asking you this because this piece of code is very common on the Internet. Most people copy it because is close to what they need but not exactly.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  4. #4
    Registered User
    Join Date
    12-03-2015
    Location
    San Jose, California
    MS-Off Ver
    2010
    Posts
    4

    Re: Ping Timeout Causing Application Hang

    I just need ping status, I don't need the number of hops or anything else. I'm just looking to see if there is basic communication to the printers, and reporting that back with a green or red cell indicating success or failure.

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Ping Timeout Causing Application Hang

    Hello broc5k,

    In that case, this macro I wrote will work for you. It pings the server 5 times with a wait time of 150 milliseconds between pings and returns either True if one or more pings was successful. If no pings were successful then False is returned.

    Ping and Return True or False
    Please Login or Register  to view this content.
    Using the Macro
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    12-03-2015
    Location
    San Jose, California
    MS-Off Ver
    2010
    Posts
    4

    Re: Ping Timeout Causing Application Hang

    Thank you very much for your response! Now, this is probably really easy but bear with me, how can I combine that with the cell coloring from the previous code?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Find/Replace Dialog causing excel to hang
    By mprice214 in forum Excel General
    Replies: 2
    Last Post: 12-02-2015, 05:07 PM
  2. workbook.close causing program to "hang-up"
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-26-2013, 12:26 PM
  3. Converting a Ping Log to Average Ping per Hour Chart
    By AndroidNine in forum Excel General
    Replies: 7
    Last Post: 08-22-2013, 01:38 AM
  4. Application.Dialogs(xlDialogOpen).Show hang
    By kcl in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-10-2011, 10:45 AM
  5. Application.screenupdating causing program lagg
    By adds007 in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 08-20-2010, 11:54 AM
  6. [SOLVED] Excel seems to hang and cause asp script to timeout.
    By Justin in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-24-2005, 12:05 PM
  7. [SOLVED] Application hang when open a schema file in Excel
    By Iv in forum Excel General
    Replies: 0
    Last Post: 02-15-2005, 11:13 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1