Serial No. of PC from VBA

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I hope somebody can help. I would like to be able to create a simple macro that will only allow certain users access to certain area's in an excel workbook which is used generally by staff. I have started by combining code (Vlookup) with a named range which is activated though an "workbook_open" procedure, but I would like to populate the named range with a list of the serial no. of the User's pc, thus is serial doesnt match then you don't get access. I am trying to avoid the use of passwords

I hope somebody can follow this

Regards

John.
 
John,

Don't know how to get the PC Serial Number, but this simple function which I
have used in the past returns the hard drive serial number

Function DriveSerialNumber() As String
Dim FSO As Object

Set FSO = CreateObject("Scripting.FileSystemObject")
DriveSerialNumber = Format(CDbl(FSO.Drives("C:").SerialNumber))
End Function

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

John said:
Hi,

I hope somebody can help. I would like to be able to create a simple
macro that will only allow certain users access to certain area's in an
excel workbook which is used generally by staff. I have started by combining
code (Vlookup) with a named range which is activated though an
"workbook_open" procedure, but I would like to populate the named range
with a list of the serial no. of the User's pc, thus is serial doesnt match
then you don't get access. I am trying to avoid the use of passwords.
 
Back
Top