worksheet that will only work on one users pc

  • Thread starter Thread starter Fan924
  • Start date Start date
F

Fan924

I am trying to create a excel worksheet that will only work on one
users pc. Oh no, not that again! I have read much of the archives
here..

I am not looking for something bullet proof. I just want to make it
difficult for the average user to pass around worksheet copies. If I
can key a macro to detect something that is unique in every users pc.
Ideas?
 
I want to read some unique system identifier such as a serial number.
I can then program macro to read that system number and closes the
workbook if it is not present.

Excel serial numbers stored in the registry are not in the same
location depending on version. I did find a routine that returns the
hard drive volume number. Not sure how unique that is.
 
This works, but is far from bullet proof.

In the workbook press Alt + F11. Find your workbook in the project window,
click on the little plus, right click "workbook" and "view code"

In the main window at the top, change the left hand drop down box to say
"Workbook" and the righthand one to say "Open"

This will appear in the main window:
Private Sub Workbook_Open()

End Sub

in the gap between Private... and End Sub paste the following:
if not environ(5) = "MyComputerName" then activeworkbook.Close

**Change "MyComputerName" to the name of the computer where this workbook is
allowed to be used!**

It's far from bullet proof, because if macros are disabled the code won't run.
 
Apologies, that should say:

if not environ(5) = "COMPUTERNAME=MyComputerName" then ...
 
why not make the workbook password protected and make sure that the user
knows the password?
 
It's far from bullet proof, because if macros are disabled the code won't run.

I found a macro that hides all sheets as the file closes. With macros
disabled, all one would see is a cover sheet. I will look over your
suggestion later today. Thanks
why not make the workbook password protected and make sure that the user
knows the password?

There is nothing stopping a person from giving the workbook & password
to 100 people.
 
It's true that a person could pass the workbook and password to 100 people,
but if they were so inclined they could copy the sheets into a new workbook
and circulate that. You're reliant on the designated user of the sheet
understanding that they're in a priveleged position and not to share it.
 
Back
Top