Get computer system and hardware information using Exel VBA

Posted on 2012-08-30
Last Modified: 2012-08-31
I'm trying write a macro to get my computer system and hardware information.  Currently, I have the below code.  However, it doesn't provide the graphic card information, and computer information like processor speed, amount of RAM (ex. Intel(R) Core(TM)2 Duo CPU P8700 @ 2.53 GHz, 3.45 GB of RAM, etc..).  Is there a way to do this?


Sub GetCInfo()
Dim i As Long, y As String, count As Variant
count = 1

For i = 1 To 39
 Range("A" & count) = Environ(i)
 count = count + 1

End Sub
Question by:jbirkku
    LVL 14

    Accepted Solution

    You can use WMI.
    I am not a huge user of VBA, so all I can give you is a guide to the overall WMI.

    You can then use something like this

    To find the specific parts of the PC you care about, and then edit your code for what you want. I could not find the WMI Code Creator I use, but this should work just as well.

    Author Comment

    Thanks!  I could find everything except for the amount of RAM installed.  Using WMI, Do you know where I could find that information?

    Author Closing Comment

    Thanks!  I could find all the information I needed except for the amount of RAM installed.  Using WMI, Do you know where I can find this information?
    LVL 14

    Expert Comment

    RAM is in a few places, but its stored as bytes.I believe it is in system, BIOS among others. Once you have it, you then need to truncated the number, round it or do the real math to covert it from 3.45 billion bytes (3450000000000) to a gb form.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Suggested Solutions

    Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
    Article by: Leon
    Software Metering within our group of companies has always been an afterthought until auditing of software and licensing became a pain point. Orchestrator and SCCM metering gave us the answer and it was an exciting process.
    Viewers will learn the basics of slicers and timelines for both PivotTables and standard Excel tables in Excel 2013.
    This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

    728 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

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now