Protect your data base by Processor Serial Number Question

  • Thread starter Thread starter a
  • Start date Start date
A

a

This code is used to know Your Computer Processor Number

I think there are Missed reference or Module declaration section

First Question

Can any programmer Help me to complete this code and give me missed
reference or module declaration section



====================

Dim objCPUSet As SWbemObjectSet

Dim objWMINameSpace As SWbemServices

Dim oCpu As SWbemObject

Set objWMINameSpace = GetObject("winmgmts:")

Set objCPUSet = objWMINameSpace.InstancesOf("Win32_Processor")

For Each oCpu In objCPUSet

Txt10 = oCpu.ProcessorID

Exit For

Next

Set oCpu = Nothing

Set objCPUSet = Nothing

Set objWMINameSpace = Nothing

==============================

Compile error:

User-defined type not defined



Second Question:

Is this code work for only single data base for one computer or I can use
this code and the data base work on many computer (Network)?

Example

I put the data base on server and take shortcut to every client computer

Thank you
 
Just replace the three Dim statements at the top with

Dim objCPUSet As Object
Dim objWMINameSpace As Object
Dim oCpu As Object
 
Do you have the reference library added to your Tools --> Refrences in
your VBA editor?

you should see "Microsoft WMI Scripting Library" in the list of chosen
libraries.

Your code works fine in my computer by having that in my list of
refrences.
 
Back
Top