Protect your data base by Processor Serial Number Question

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
 
D

Douglas J. Steele

Just replace the three Dim statements at the top with

Dim objCPUSet As Object
Dim objWMINameSpace As Object
Dim oCpu As Object
 
N

Naeem Azizian

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top