regards
Paul Keating
Do you know specifically what machine? If so, one very simple way would be
to check the serial number of the C: drive. Simpler than reading the
registry.
Dim FSO As Scripting.FileSystemObject
Set FSO = New Scripting.FileSystemObject
If FSO.GetDrive("C:").SerialNumber <> 123456 Then
MsgBox "Wrong machine"
End If
From the VBA Tools menu, go to References, and put a check next to
"Microsoft Scripting Runtime". You need to have one of more of Windows98,
Windows2000, Visual Studio 6, Internet Explorer 5, or Office2000.
--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting Services
www.cpearson.com ch...@cpearson.com
"Paul Keating" <N...@btinternet.com> wrote in message
news:eUN1RUDh$GA....@cppssbbsa02.microsoft.com...
>Do you know specifically what machine? If so, one very simple way would be
>to check the serial number of the C: drive. Simpler than reading the
>registry.
>
>Dim FSO As Scripting.FileSystemObject
>Set FSO = New Scripting.FileSystemObject
>If FSO.GetDrive("C:").SerialNumber <> 123456 Then
> MsgBox "Wrong machine"
>End If
>
>From the VBA Tools menu, go to References, and put a check next to
>"Microsoft Scripting Runtime". You need to have one of more of Windows98,
>Windows2000, Visual Studio 6, Internet Explorer 5, or Office2000.
If your user has a hard-drive crash and must replace the drive, he isn't going
to be very fond of you <g>.
Of course, but that assumes that the users are fond of me to begin with.
That's debatable. And if you have a drive crash, the registry is gone, too,
so you can't use a registry entry, either. Basically, there is really no
way to distribute a program (or workbook) and be able to ensure that it can
only run on a single machine, and cannot be copied to another machine.
If the drive s/n is known ahead of time (which seemed to be implied by the
original post), then using the FileSystemObject is a pretty simple way to
get a unique ID of the system. And hard drive crashes are very rare, these
days. My new Western Digital drive is rated at about 500,000 hours Mean
Time Between Failures, more than 50 years.
--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting Services
www.cpearson.com ch...@cpearson.com
"Myrna Larson" <myrna...@home.net> wrote in message
news:t40ubs45tu383mkao...@4ax.com...
Just a little shared experience.
Regards,
Tom Ogilvy
Chip Pearson wrote in message ...
There is no "sure fire" solution that I have found. I sure would love to have
some dialog on this issue.