efighettib
Structural
Hello
I think that this tip may be helpfull. If you want to authorize certain computers that can run an excel spreadsheet, you should do the following.
In a module,
Public Declare Function GetVolumeSerialNumber Lib "kernel32" Alias "GetVolumeInformationA" (ByVal lpRootPathName As String, ByVal lpVolumeNameBuffer As Long, ByVal nVolumeNameSize As Long, lpVolumeSerialNumber As Long, ByVal lpMaximumComponentLength As Long, ByVal lpFileSystemFlags As Long, ByVal lpFileSystemNameBuffer As Long, ByVal nFileSystemNameSize As Long) As Long
Public Function VolumeSerial(DriveLetter) As Long
Dim Serial As Long
Call GetVolumeSerialNumber(UCase(DriveLetter) & ":\", 0&, 0&, Serial, 0&, 0&, 0&, 0&)
VolumeSerial = Serial
End Function
this code will return the selected volume serial number, wich is unique.
Then,
Sub Autpen()
C1 = VolumeSerial("C")
if C1<>your serial thenActiveWorkbook.Close
end sub
Off course you can add more serials to run the spreadsheet.
Hope this helps.
Enzo.
I think that this tip may be helpfull. If you want to authorize certain computers that can run an excel spreadsheet, you should do the following.
In a module,
Public Declare Function GetVolumeSerialNumber Lib "kernel32" Alias "GetVolumeInformationA" (ByVal lpRootPathName As String, ByVal lpVolumeNameBuffer As Long, ByVal nVolumeNameSize As Long, lpVolumeSerialNumber As Long, ByVal lpMaximumComponentLength As Long, ByVal lpFileSystemFlags As Long, ByVal lpFileSystemNameBuffer As Long, ByVal nFileSystemNameSize As Long) As Long
Public Function VolumeSerial(DriveLetter) As Long
Dim Serial As Long
Call GetVolumeSerialNumber(UCase(DriveLetter) & ":\", 0&, 0&, Serial, 0&, 0&, 0&, 0&)
VolumeSerial = Serial
End Function
this code will return the selected volume serial number, wich is unique.
Then,
Sub Autpen()
C1 = VolumeSerial("C")
if C1<>your serial thenActiveWorkbook.Close
end sub
Off course you can add more serials to run the spreadsheet.
Hope this helps.
Enzo.