+ Reply to Thread
Results 1 to 3 of 3

Get WMI Win32 classes info with VBA

  1. #1
    Registered User
    Join Date
    02-21-2010
    Location
    Italy
    MS-Off Ver
    Excel 2013
    Posts
    77

    Question Get WMI Win32 classes info with VBA

    Dear All,
    such a long time from my last post but hopefully I'm here again to find some help.
    This time I'm trying to get system info via WMI with Excel VBA and I wanted to ask some advices.

    My goal is to list all values for each property of a give WMI.Win32_xxxx class.
    My question is about how to get all the keys for all properties listed without actually write in my code all properties' names.

    I explain myself better, I have the code below:

    Please Login or Register  to view this content.
    It's a simple code in which I call a function passing the class I want to list the properties' values from.
    Since the class Win32_OperatingSystem contains 63 properties, I'm wondering if is there a way to loop through all of them in order to get those data without writing all the names of the properties.
    I mean, something like:


    Please Login or Register  to view this content.
    Unluckily this code doesn't work because I'm not referencing correctly the structure of the class.

    Any help would be highly appreciated.

    regards,
    PP
    Last edited by fredpox; 05-31-2013 at 01:09 PM. Reason: SOLVED

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Get WMI Win32 classes info with VBA

    The swbemobject has a properties_ property
    Please Login or Register  to view this content.
    there is also a Methods_ property :-)
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Registered User
    Join Date
    02-21-2010
    Location
    Italy
    MS-Off Ver
    Excel 2013
    Posts
    77

    Re: Get WMI Win32 classes info with VBA

    Dear Joseph, thanks a lot for your valuable help! That did the trick!

    PS just a small correction in your first string (added the bracket at the end of the line)
    Please Login or Register  to view this content.
    Thanks again

    Best regards,
    Paolo

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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