+ Reply to Thread
Results 1 to 3 of 3

Password setting syntax

  1. #1
    Dave
    Guest

    Password setting syntax

    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



  2. #2
    Jim Cone
    Guest

    Re: 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" <[email protected]> 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

  3. #3
    Dave
    Guest

    Re: Password setting syntax

    Hi Jim
    Thanks for that - works a treat
    Dave.

    "Jim Cone" <[email protected]> wrote in message
    news:[email protected]...
    > 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" <[email protected]> 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




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1