• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Excel file to be opened on specific PCs.

Hi,


I want to protect my data sheet so that it can not be opened on any PC (other than specified one).


I want to create a macro which stores "Computer Name"/"User Name" then matches on finding the current "Computer Name"/"User Name", if it does not matches then file closes or does not open, otherwise it gives an error that "Parameter does not match".


Kindly Help.

Thank you all for Help (in Advance).
 
Hi Shekhar ,


Run the following code in Excel , and see what environment variables or what combination of them will give you some fool-proof method of checking for one particular PC or environment.


Sub List_Environment_Variables()

Dim i As Integer


For i = 1 To 80

Debug.Print VBA.Environ(i)

Next i


End Sub


This is copied from the following link :


http://www.xtremevbtalk.com/showthread.php?t=315656


Narayan
 
Back
Top