View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Cone Jim Cone is offline
external usenet poster
 
Posts: 3,290
Default Password setting syntax

Dave,

The Protect method requires a string for the password...
ActiveSheet.Protect "dave"

Also, if you enter "Option Explicit" (without the quote marks)
as the first line in the module it will flag such mistakes.

Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"Dave" wrote in message
Hi,
I'm trying to write code that protects the active sheet, using a password
(eg: dave)
I've tried:

ActiveSheet.Protect (dave)
and
ActiveSheet.Protect Password:=dave

Both these lines of code protect the sheet, but allow it to be unprotected
without prompting for the password
I'm using XL2000, and can't find it in the VBA help.
Regards - Dave