• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Computer ID - Code no

nagovind

Member
Is it possible to get the computer / motherboard ID using Excel VBA

If Yes Please provide the code


Thanks
 
Have a look at this post at Ozgrid.com

http://www.ozgrid.com/forum/showthread.php?t=11410
 
Thanks Hui


It is ok but it only returns Computer NAME and not the Motherboard ID

Computer name can be changed randomly but mother board is not so i need to lock the Excel sheet with respect to the specific computers that is the idea behind this query


thanks
 
Maybe like following:
Code:
Public Sub GetMotherBoardProp()
Dim strComputer As String
Dim objSvcs As Object
Dim objItms As Object, objItm As Object
Dim vItem
strComputer = "."
Set objSvcs = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set objItms = objSvcs.execquery("Select * from Win32_BaseBoard")
For Each objItm In objItms
    MsgBox objItm.SerialNumber
Next
Set objSvcs = Nothing
End Sub

This sort of information may not be easily available if you search only for VBA on net. You will get codes for Vbscript, VB.Net which needs to be adopted. e.g.
https://social.msdn.microsoft.com/F...-somewhere-in-windows-desktop?forum=vbgeneral
One of the posts there says not all motherboards return serial number.
 
Back
Top