locked
VBA Internet speed RRS feed

  • Question

  • Hi I'm new to this type of scripting however know a bid of VBA and MSaccess. However this is my first project using WMI.

    Did a function with pingstatus that went well.

    I'm now trying to measure my internet speed on this PC and get the value in MSaccess. I searched around and can now find at least my network adapter.

    Function nw()strComputer = "."
    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
    Set colItems = objWMIService.ExecQuery( _
        "SELECT * FROM Win32_NetworkAdapter WHERE NetConnectionStatus = 2", , 48)
    For Each objItem In colItems
        Debug.Print "-----------------------------------"
        Debug.Print "Win32_NetworkAdapter instance"
        Debug.Print "-----------------------------------"
        Debug.Print "Name: " & objItem.Name
    Next
    
    End Function
    


    Now what I like to do is get the mom. speed on that adapter 

    The same as what you can see on the "windows task manager/networking/networkutilization"

    I tried every property in the win32_network adapter but can't find the right one.

    All help appreciated. 

    • Moved by Bill_Stewart Saturday, July 19, 2014 2:54 PM Question outside forum scope
    Friday, May 9, 2014 9:53 AM

Answers

All replies

  • It is not on the adapter.  The utilization is a performance number.  Run Perfmon and look at the network data.

    Counters are an advanced element of scripting.  Search for examples.

    https://www.google.com/#newwindow=1&q=wmi+performance


    ¯\_(ツ)_/¯

    Friday, May 9, 2014 10:18 AM
  • Here is a sample of what you can get with some effort.  (click to enlarge http://1drv.ms/1gfeD8C)


    ¯\_(ツ)_/¯



    • Edited by jrv Friday, May 9, 2014 10:27 AM
    • Proposed as answer by Alex Brassington Friday, May 16, 2014 2:56 PM
    • Marked as answer by Just Karl Monday, July 21, 2014 9:31 PM
    Friday, May 9, 2014 10:25 AM
  • Hi JRV,

    Thanks! works like a charm Cool program you are showing. Thanks for helping me get started with the WMI stuff.

    Friday, May 16, 2014 2:54 PM