Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Is there a envstring for the Environ() function that will return a unique value, such as a serial # of the processor, Windows, Office, etc? I want to setup some type of security should the XLS and not the XLT be copied for use on another computer. I have no problem with the copying, it's just that there will be CC info stored in the existing XLS file and I don't want that to be distributed. If I can check for two or three unique serials, I can have the routine clear the existing data and reset the XLS to it's original delivered status. By having more than one serial # to check, I can make sure the reset won't happen should a minor hardware swap take place. Sometime ago, I worked on a project in FoxPro where the code used a primary harddrive serial # as a seed for an activation code. Was look for a similar avenue if it's not too complicated. Thx, JG |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
ENVIRON() gives you the UserName , ComputerName. Will help ??
Msgbox Environ("UserName") Msgbox Environ("ComputerName") If this post helps click Yes --------------- Jacob Skaria "John G." wrote: Is there a envstring for the Environ() function that will return a unique value, such as a serial # of the processor, Windows, Office, etc? I want to setup some type of security should the XLS and not the XLT be copied for use on another computer. I have no problem with the copying, it's just that there will be CC info stored in the existing XLS file and I don't want that to be distributed. If I can check for two or three unique serials, I can have the routine clear the existing data and reset the XLS to it's original delivered status. By having more than one serial # to check, I can make sure the reset won't happen should a minor hardware swap take place. Sometime ago, I worked on a project in FoxPro where the code used a primary harddrive serial # as a seed for an activation code. Was look for a similar avenue if it's not too complicated. Thx, JG |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Jacob, thx for the reply. I have run through the whole list of envstring, those two in particular, and don't see any problem using those just was wondering if there's a function that might get me a little deeper, ie, serial #'s. JG "Jacob Skaria" wrote: ENVIRON() gives you the UserName , ComputerName. Will help ?? Msgbox Environ("UserName") Msgbox Environ("ComputerName") If this post helps click Yes --------------- Jacob Skaria "John G." wrote: Is there a envstring for the Environ() function that will return a unique value, such as a serial # of the processor, Windows, Office, etc? I want to setup some type of security should the XLS and not the XLT be copied for use on another computer. I have no problem with the copying, it's just that there will be CC info stored in the existing XLS file and I don't want that to be distributed. If I can check for two or three unique serials, I can have the routine clear the existing data and reset the XLS to it's original delivered status. By having more than one serial # to check, I can make sure the reset won't happen should a minor hardware swap take place. Sometime ago, I worked on a project in FoxPro where the code used a primary harddrive serial # as a seed for an activation code. Was look for a similar avenue if it's not too complicated. Thx, JG |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I found this code but it only seems to produce the disk partitiion ID's and not motherboard, processor, and bios. It it even possible? Private Sub GetSerials() Dim List, Msg, Object On Local Error Resume Next Set List = GetObject("winmgmts:{impersonationLevel=impersonat e}").InstancesOf("Win32_BaseBoard") For Each Object In List Msg = Msg & "Motherboard Serial Number: " & Object.SerialNumber & vbCrLf Next Set List = GetObject("winmgmts:{impersonationLevel=impersonat e}").InstancesOf("Win32_Processor") For Each Object In List Msg = Msg & "Processor Unique ID: " & Object.UniqueID & vbCrLf Next Set List = GetObject("winmgmts:{impersonationLevel=impersonat e}").InstancesOf("Win32_BIOS") For Each Object In List Msg = Msg & "BIOS Serial Number: " & Object.SerialNumber & vbCrLf Next Set List = GetObject("winmgmts:{impersonationLevel=impersonat e}").InstancesOf("Win32_LogicalDisk") For Each Object In List Msg = Msg & "Disk Serial Number: " & Object.VolumeSerialNumber & vbCrLf Next MsgBox Msg End Sub "John G." wrote: Is there a envstring for the Environ() function that will return a unique value, such as a serial # of the processor, Windows, Office, etc? I want to setup some type of security should the XLS and not the XLT be copied for use on another computer. I have no problem with the copying, it's just that there will be CC info stored in the existing XLS file and I don't want that to be distributed. If I can check for two or three unique serials, I can have the routine clear the existing data and reset the XLS to it's original delivered status. By having more than one serial # to check, I can make sure the reset won't happen should a minor hardware swap take place. Sometime ago, I worked on a project in FoxPro where the code used a primary harddrive serial # as a seed for an activation code. Was look for a similar avenue if it's not too complicated. Thx, JG |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
To get serial number of mother board; try the below function..
Public Function MBSerialNumber() As String Dim objs As Object, obj As Object, objWM As Object Set objWM = GetObject("WinMgmts:") Set objs = objWM.InstancesOf("Win32_BaseBoard") For Each obj In objs MBSerialNumber = "," & MBSerialNumber & obj.SerialNumber Next MBSerialNumber = Mid(MBSerialNumber, 2) End Function If this post helps click Yes --------------- Jacob Skaria "John G." wrote: I found this code but it only seems to produce the disk partitiion ID's and not motherboard, processor, and bios. It it even possible? Private Sub GetSerials() Dim List, Msg, Object On Local Error Resume Next Set List = GetObject("winmgmts:{impersonationLevel=impersonat e}").InstancesOf("Win32_BaseBoard") For Each Object In List Msg = Msg & "Motherboard Serial Number: " & Object.SerialNumber & vbCrLf Next Set List = GetObject("winmgmts:{impersonationLevel=impersonat e}").InstancesOf("Win32_Processor") For Each Object In List Msg = Msg & "Processor Unique ID: " & Object.UniqueID & vbCrLf Next Set List = GetObject("winmgmts:{impersonationLevel=impersonat e}").InstancesOf("Win32_BIOS") For Each Object In List Msg = Msg & "BIOS Serial Number: " & Object.SerialNumber & vbCrLf Next Set List = GetObject("winmgmts:{impersonationLevel=impersonat e}").InstancesOf("Win32_LogicalDisk") For Each Object In List Msg = Msg & "Disk Serial Number: " & Object.VolumeSerialNumber & vbCrLf Next MsgBox Msg End Sub "John G." wrote: Is there a envstring for the Environ() function that will return a unique value, such as a serial # of the processor, Windows, Office, etc? I want to setup some type of security should the XLS and not the XLT be copied for use on another computer. I have no problem with the copying, it's just that there will be CC info stored in the existing XLS file and I don't want that to be distributed. If I can check for two or three unique serials, I can have the routine clear the existing data and reset the XLS to it's original delivered status. By having more than one serial # to check, I can make sure the reset won't happen should a minor hardware swap take place. Sometime ago, I worked on a project in FoxPro where the code used a primary harddrive serial # as a seed for an activation code. Was look for a similar avenue if it's not too complicated. Thx, JG |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Thx again for the reply...I'm not getting anything back MB#. Stepped thru the function and the For...Next isn't grabbing anything. May be for the same reason the code I found didn't find it either. JG "Jacob Skaria" wrote: To get serial number of mother board; try the below function.. Public Function MBSerialNumber() As String Dim objs As Object, obj As Object, objWM As Object Set objWM = GetObject("WinMgmts:") Set objs = objWM.InstancesOf("Win32_BaseBoard") For Each obj In objs MBSerialNumber = "," & MBSerialNumber & obj.SerialNumber Next MBSerialNumber = Mid(MBSerialNumber, 2) End Function If this post helps click Yes --------------- Jacob Skaria "John G." wrote: I found this code but it only seems to produce the disk partitiion ID's and not motherboard, processor, and bios. It it even possible? Private Sub GetSerials() Dim List, Msg, Object On Local Error Resume Next Set List = GetObject("winmgmts:{impersonationLevel=impersonat e}").InstancesOf("Win32_BaseBoard") For Each Object In List Msg = Msg & "Motherboard Serial Number: " & Object.SerialNumber & vbCrLf Next Set List = GetObject("winmgmts:{impersonationLevel=impersonat e}").InstancesOf("Win32_Processor") For Each Object In List Msg = Msg & "Processor Unique ID: " & Object.UniqueID & vbCrLf Next Set List = GetObject("winmgmts:{impersonationLevel=impersonat e}").InstancesOf("Win32_BIOS") For Each Object In List Msg = Msg & "BIOS Serial Number: " & Object.SerialNumber & vbCrLf Next Set List = GetObject("winmgmts:{impersonationLevel=impersonat e}").InstancesOf("Win32_LogicalDisk") For Each Object In List Msg = Msg & "Disk Serial Number: " & Object.VolumeSerialNumber & vbCrLf Next MsgBox Msg End Sub "John G." wrote: Is there a envstring for the Environ() function that will return a unique value, such as a serial # of the processor, Windows, Office, etc? I want to setup some type of security should the XLS and not the XLT be copied for use on another computer. I have no problem with the copying, it's just that there will be CC info stored in the existing XLS file and I don't want that to be distributed. If I can check for two or three unique serials, I can have the routine clear the existing data and reset the XLS to it's original delivered status. By having more than one serial # to check, I can make sure the reset won't happen should a minor hardware swap take place. Sometime ago, I worked on a project in FoxPro where the code used a primary harddrive serial # as a seed for an activation code. Was look for a similar avenue if it's not too complicated. Thx, JG |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Not at all clear on use of variables and/or object variables | Excel Discussion (Misc queries) | |||
Storing variables in a macro and using those variables to performcalculations. | Excel Programming | |||
variables | Excel Programming | |||
Too many variables? | Excel Worksheet Functions | |||
Using variables in RCs | Excel Programming |