tony.reynolds
Board Regular
- Joined
- Jul 8, 2010
- Messages
- 97
I refer to post http://www.mrexcel.com/forum/showthread.php?t=550350 where I then wrote this simple code the produce the machine serialnumber
I would like the function to refer to to the serial number to return the name of the licenced user or if the serial number is not in the list of users it returns "Not Licensed"
So
So in any code within the Project we can check..
Can someone help me do this
Code:
Const sKey As String = "SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName"
MsgBox QueryValue(sKey, HKEY_LOCAL_MACHINE, "ComputerName")
I would like the function to refer to to the serial number to return the name of the licenced user or if the serial number is not in the list of users it returns "Not Licensed"
So
Code:
Function MachineReigistration()
LicencedTo = "Not Licensed"
If SerialNumber = "MCA074075" Then LicensedTo = "Tony"
If SerialNumber = "MCA069595" Then LicensedTo = "Ellen"
If SerialNumber = "MCA073878" Then LicensedTo = "Estelle"
If SerialNumber = "MCA026058" Then LicensedTo = "Leonie"
If SerialNumber = "MCA026062" Then LicensedTo = "Doug"
End Function
So in any code within the Project we can check..
Code:
Sub TestMachineRegistration()
If LicensedTo = "Not Licensed" then Exit Sub
'Procedure here if all ok
MsgBox LicensedTo
End Sub
Can someone help me do this