View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike Mike is offline
external usenet poster
 
Posts: 3,101
Default How to protect a workbook?

Any way you do this you will ultimately have to rely on the protection within
the workbook and as we are probably agreed there is little protection
available there.

However, one way is to have the workbook check for the existance of a file
which is only present on the authors drive, if the file isn't there then the
workbook simply closes. Code such as:-

Private Sub Workbook_Open()
If Dir("c:\trial.txt") < "" Then
MsgBox ("OK to run")
Else
ActiveWorkbook.Close savechanges:=False 'close application
End If
End Sub

However, as stated the main drawback is that anyone even moderately
determined would be able to break into your code and check what you were
doing and defeat it. If it was easy there wouldn't be so much pirate software
about.

Mike

" wrote:


Hello

I would like to know what would be the best way to protect a
workbook(not the routine protect workbook), so that the workbook
becomes ineffective or uneditable if copied into any other
computer(even through LAN) or harddisk.

Only the author of the workbook should have the rights to copy the
workbook into another hardidsk or computer.

Can anyone suggest a way to do this?
Thanks
Rajesh