Thread: Code or Even ?
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz JLGWhiz is offline
external usenet poster
 
Posts: 3,986
Default Code or Even ?

Hi Mike, You wrote "Substitute xxxx for your computername and note
it's case sensitive."

Did you mean "Substitute your computername for "xxxx" and note
it's case sensitive"?



"Mike H" wrote:

Hi,

I doub't there's any foolproff way but you could do this. On closing your
workbook hide all sheets except one with no information in it and have this
in the workbook open event. Substitute xxxx for your computername and note
it's case sensitive.

Private Sub Workbook_Open()
If Environ("Computername") < "xxxxx" Then
ActiveWorkbook.Close savechanges:=False
Else
For Each Worksheet In ThisWorkbook.Worksheets
Worksheet.Visible = True
Next
End If
End Sub

Mike


"Tufail" wrote:

hello all,
is there any code or event that doesn't allow to open my work book in any
other computer ? Yes i am protected my WB with PW.