Results 1 to 10 of 10

Thread: Pinging IP Address - Excel Form

  1. #1
    HEXUS.social member Disturbedguy's Avatar
    Join Date
    Nov 2006
    Location
    Manchester
    Posts
    5,113
    Thanks
    841
    Thanked
    482 times in 357 posts
    • Disturbedguy's system
      • Motherboard:
      • Asus Rog Strix Z370-H Gaming
      • CPU:
      • i7 8700K
      • Memory:
      • 16GB Corsair something or other
      • Storage:
      • 1 x Samsung 960 EVO (250GB) 1 x Samsung 850 EVO (500GB)
      • Graphics card(s):
      • GTX 1080Ti
      • Operating System:
      • Windows 7 Ultimate
      • Monitor(s):
      • 32inch Samsung TV
      • Internet:
      • Crap

    Pinging IP Address - Excel Form

    Hi all,

    Hoping for some quick help.

    I have a form that will list an router IP address (The IP is in a label).

    I know there are ways to ping an IP address that is within a cell in Excel, however I was wondering if it was possible, to have it so I click a button and it pings an IP address.

    The only way I can think of doing it, is that in the code assigned to the button, the IP address is there and then when pressing the button it launches command prompt and pings the IP address.

    Does anyone know how to do this / weather its possible?

    Thanks in advance for replies.
    Quote Originally Posted by TAKTAK View Post
    It didn't fall off, it merely became insufficient at it's purpose and got a bit droopy...

  2. #2
    Seething Cauldron of Hatred TheAnimus's Avatar
    Join Date
    Aug 2005
    Posts
    17,168
    Thanks
    803
    Thanked
    2,152 times in 1,408 posts

    Re: Pinging IP Address - Excel Form

    Easy, do it all in VBA. Shelling the command prompt is nasty.

    http://social.technet.microsoft.com/...m-vba-in-excel

    Has an example using WMI.

    You could take the example they have, and make it use an input from a cell or similar, if you do use a Cell set it to a Named Range.
    throw new ArgumentException (String, String, Exception)

  3. #3
    Seething Cauldron of Hatred TheAnimus's Avatar
    Join Date
    Aug 2005
    Posts
    17,168
    Thanks
    803
    Thanked
    2,152 times in 1,408 posts

    Re: Pinging IP Address - Excel Form

    Also to add, if its not on the domain and you can't use WMI, the much more fun way with winsock:
    http://www.vbaexpress.com/forum/arch...hp/t-5233.html
    throw new ArgumentException (String, String, Exception)

  4. #4
    HEXUS.social member Disturbedguy's Avatar
    Join Date
    Nov 2006
    Location
    Manchester
    Posts
    5,113
    Thanks
    841
    Thanked
    482 times in 357 posts
    • Disturbedguy's system
      • Motherboard:
      • Asus Rog Strix Z370-H Gaming
      • CPU:
      • i7 8700K
      • Memory:
      • 16GB Corsair something or other
      • Storage:
      • 1 x Samsung 960 EVO (250GB) 1 x Samsung 850 EVO (500GB)
      • Graphics card(s):
      • GTX 1080Ti
      • Operating System:
      • Windows 7 Ultimate
      • Monitor(s):
      • 32inch Samsung TV
      • Internet:
      • Crap

    Re: Pinging IP Address - Excel Form

    Thanks Animus.

    Call me stupid but I can't see how to use this? (I'm not much of a code monkey, only had limited experience / exposure)
    Quote Originally Posted by TAKTAK View Post
    It didn't fall off, it merely became insufficient at it's purpose and got a bit droopy...

  5. #5
    HEXUS.social member Disturbedguy's Avatar
    Join Date
    Nov 2006
    Location
    Manchester
    Posts
    5,113
    Thanks
    841
    Thanked
    482 times in 357 posts
    • Disturbedguy's system
      • Motherboard:
      • Asus Rog Strix Z370-H Gaming
      • CPU:
      • i7 8700K
      • Memory:
      • 16GB Corsair something or other
      • Storage:
      • 1 x Samsung 960 EVO (250GB) 1 x Samsung 850 EVO (500GB)
      • Graphics card(s):
      • GTX 1080Ti
      • Operating System:
      • Windows 7 Ultimate
      • Monitor(s):
      • 32inch Samsung TV
      • Internet:
      • Crap

    Re: Pinging IP Address - Excel Form

    Ok, I've managed to get something working, slightly different then what I wanted but its somewhat working.
    It displays the response times and the bytes but it doesnt seem to display the TTL which I would like it to, ive had a quick look but can't see how to / if its possible to display the TTL.

    I am using the last suggestion

    Edit - Maybe its not working how I want it to, I want it to ping (if possible) how it would if I were doing it from command prompt. However the one I am using, however pings based on what I put in a text box, so as an example if I ping with the data test, I am told the packet size is 4 bytes (obviously) and it gives me the MS too.
    Last edited by Disturbedguy; 19-06-2013 at 02:43 PM.
    Quote Originally Posted by TAKTAK View Post
    It didn't fall off, it merely became insufficient at it's purpose and got a bit droopy...

  6. #6
    Seething Cauldron of Hatred TheAnimus's Avatar
    Join Date
    Aug 2005
    Posts
    17,168
    Thanks
    803
    Thanked
    2,152 times in 1,408 posts

    Re: Pinging IP Address - Excel Form

    Well ping is really an ICMP Echo request, the other person replies with a 'pong' the same data to detect corruption. As ICMP is lower level protocol than TCP/IP it is very possible for it to be a corrupt response that you get back (garbaled response).

    You can just create a string with the Space function.

    So you can take the code that reads the textbox, and use Space(512) if you want instead.
    throw new ArgumentException (String, String, Exception)

  7. #7
    HEXUS.social member Disturbedguy's Avatar
    Join Date
    Nov 2006
    Location
    Manchester
    Posts
    5,113
    Thanks
    841
    Thanked
    482 times in 357 posts
    • Disturbedguy's system
      • Motherboard:
      • Asus Rog Strix Z370-H Gaming
      • CPU:
      • i7 8700K
      • Memory:
      • 16GB Corsair something or other
      • Storage:
      • 1 x Samsung 960 EVO (250GB) 1 x Samsung 850 EVO (500GB)
      • Graphics card(s):
      • GTX 1080Ti
      • Operating System:
      • Windows 7 Ultimate
      • Monitor(s):
      • 32inch Samsung TV
      • Internet:
      • Crap

    Re: Pinging IP Address - Excel Form

    Quote Originally Posted by TheAnimus View Post
    Well ping is really an ICMP Echo request, the other person replies with a 'pong' the same data to detect corruption. As ICMP is lower level protocol than TCP/IP it is very possible for it to be a corrupt response that you get back (garbaled response).
    - Thanks this makes sense.


    Quote Originally Posted by TheAnimus View Post
    You can just create a string with the Space function.

    So you can take the code that reads the textbox, and use Space(512) if you want instead.
    Not quite sure what you mean by this. But I guess if I just want to test if something (in this case a router) is receiving a ping or not, then what I have at the moment is doing the job.
    Quote Originally Posted by TAKTAK View Post
    It didn't fall off, it merely became insufficient at it's purpose and got a bit droopy...

  8. #8
    Splash
    Guest

    Re: Pinging IP Address - Excel Form

    I'd be interested to know why you're wanting to do this from a spreadsheet. I'm sure there's a reason, but checking a router is up is the job of your network monitoring software (and surely you have something there if you're still working at the same please?) - this kind of data should be automated and logged to a database, generating relevant alerts for exceptions.

  9. #9
    HEXUS.social member Disturbedguy's Avatar
    Join Date
    Nov 2006
    Location
    Manchester
    Posts
    5,113
    Thanks
    841
    Thanked
    482 times in 357 posts
    • Disturbedguy's system
      • Motherboard:
      • Asus Rog Strix Z370-H Gaming
      • CPU:
      • i7 8700K
      • Memory:
      • 16GB Corsair something or other
      • Storage:
      • 1 x Samsung 960 EVO (250GB) 1 x Samsung 850 EVO (500GB)
      • Graphics card(s):
      • GTX 1080Ti
      • Operating System:
      • Windows 7 Ultimate
      • Monitor(s):
      • 32inch Samsung TV
      • Internet:
      • Crap

    Re: Pinging IP Address - Excel Form

    Quote Originally Posted by Splash View Post
    I'd be interested to know why you're wanting to do this from a spreadsheet. I'm sure there's a reason, but checking a router is up is the job of your network monitoring software (and surely you have something there if you're still working at the same please?) - this kind of data should be automated and logged to a database, generating relevant alerts for exceptions.
    Nope, not working at the same place any more, had a new job for just about a month now and thus far I haven't seen any network monitoring software, unless I just haven't been introduced to it.

    Basically we have a number of depots across the UK, so I was wanting to come up with something pretty basic, that we can use to ping to ping routers, without having to search for the IP address would be advantageous and quicker.

    Will likely hold other information too, but it's just an idea at the moment.
    Quote Originally Posted by TAKTAK View Post
    It didn't fall off, it merely became insufficient at it's purpose and got a bit droopy...

  10. #10
    Account closed at user request
    Join Date
    Aug 2003
    Location
    Elephant watch camp
    Posts
    2,150
    Thanks
    56
    Thanked
    115 times in 103 posts
    • wasabi's system
      • Motherboard:
      • MSI B85M-G43
      • CPU:
      • i3-4130
      • Memory:
      • 8 gig DDR3 Crucial Rendition 1333 - cheap!
      • Storage:
      • 128 gig Agility 3, 240GB Corsair Force 3
      • Graphics card(s):
      • Zotac GTX 750Ti
      • PSU:
      • Silver Power SP-S460FL
      • Case:
      • Lian Li T60 testbanch
      • Operating System:
      • Win7 64bit
      • Monitor(s):
      • First F301GD Live
      • Internet:
      • Virgin cable 100 meg

    Re: Pinging IP Address - Excel Form

    This looks ready made for what you want to do if you can get $35 signed off....
    http://www.checkthenetwork.com/iptoolsforExcel1.asp

Thread Information

Users Browsing this Thread

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

Posting Permissions

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