+ Reply to Thread
Results 1 to 2 of 2

ActiveWorkbook.Protect password:=range("rangename") does not work

  1. #1
    WimR
    Guest

    ActiveWorkbook.Protect password:=range("rangename") does not work

    I am trying to have macro protecting a workbook, with a password
    specified by an administrator in one of the hidden worksheets.
    The cell in the hidden worksheet in which the password is specified is
    named, so I want to use the range name in the macro that
    protects/unprotects the workbook.


    It all works well when I try to unprotect the workbook, using the code
    : ActiveWorkbook.Unprotect password:=range("rangename").
    However, I get an error when I try to protect the workbook with the
    code: ActiveWorkbook.Protect password:=range("rangename")
    The error message is: Runtime Error "1004, Application-defined or
    Object-defined error.


    Can anybody help ?


    Many Thanks
    Wim Ruepert
    Sydney, Australia


  2. #2
    abcd
    Guest

    Re: ActiveWorkbook.Protect password:=range("rangename") does notwork

    the cell is not a password, but its content (the value) may be one:

    try:

    range("rangename").value

+ 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