Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Reading desktop/Notebook serial number or system ID

Nothing, I just wanted to give you the whole picture :)
Thank you RBS.

OMER

"RB Smissaert" wrote:

Any other ideas?


What is wrong with the current setup then?

RBS


"OMER" wrote in message
...
The whole picture is that I want to tie the ID to the workbook, so that it
only runs in the registered machine. Any other ideas?

OMER

"RB Smissaert" wrote:

I assume that since these are functions I can used them as regular
user-defined functions and assigned them to a specific cell. Is that
correct?

Yes, that should work, but not sure why you would want that.

RBS


"OMER" wrote in message
...
Thank you very much RBS,
I'll try this.

I assume that since these are functions I can used them as regular
user-defined functions and assigned them to a specific cell. Is that
correct?

Regards,
OMER

"RB Smissaert" wrote:

You could try the GetVolumeInformation API:

Private Declare Function GetVolumeInformation _
Lib "kernel32" _
Alias "GetVolumeInformationA" _
(ByVal lpRootPathName As String, _
ByVal lpVolumeNameBuffer As String, _
ByVal nVolumeNameSize As Long, _
lpVolumeSerialNumber As Long, _
lpMaximumComponentLength As Long, _
lpFileSystemFlags As Long, _
ByVal lpFileSystemNameBuffer As String,
_
ByVal nFileSystemNameSize As Long) As
Long

Function getDriveVolumeSerial(Optional strDriveLetter As String) As
String

'will get the drive serial number
'default is the drive that the application is on
'otherwise can do for example: getDriveSerialNumber("D")
'-------------------------------------------------------

Dim strDrivePath As String
Dim Serial As Long
Dim VName As String
Dim FSName As String

If Len(strDriveLetter) = 0 Then
strDrivePath = Left$(Application.Path, 1) & ":\"
Else
strDrivePath = strDriveLetter & ":\"
End If

'Create buffers
VName = String$(255, Chr$(0))
FSName = String$(255, Chr$(0))

'Get the volume information
GetVolumeInformation strDrivePath, VName, 255, Serial, 0, 0, FSName,
255

getDriveVolumeSerial = Trim(Str$(Abs(Serial)))

End Function


Run it from the ThisWorkbook module in the Private Sub Workbook_Open()



RBS


"OMER" wrote in message
...
Hola,
I need to know how to read serial number, system ID or Windows ID
from
an
Excel macro.
I want to use this to limit a workbook to run only on the
desktop/notebook
that is licensed to.

Any help on achieving this or an alternative method is highly
appreciated.
Regards,







Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Easy Reading - large number minus small number MUTTMIND New Users to Excel 5 February 5th 09 10:08 AM
Serial Number Fareez Excel Worksheet Functions 8 January 24th 09 11:50 PM
Look up part of a number within a serial number and cpy back assoc Seantastic Excel Worksheet Functions 9 November 3rd 08 04:10 PM
Help, My Notebook pages are not in my notebook Heidi H Excel Discussion (Misc queries) 1 January 1st 07 09:34 PM
Serial Number Jason Zischke Excel Programming 4 February 9th 06 06:05 PM


All times are GMT +1. The time now is 05:48 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"