Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default ActiveWorkbook.Protect password:=range("rangename") does notwork

the cell is not a password, but it's value is


range("rangename").value
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default 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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to password-protect "VeryHidden" worksheet exalan New Users to Excel 4 May 9th 09 08:13 AM
OT I would want protect my sheets of excel from a "password recovery" software... How? -= Luca =- Excel Worksheet Functions 3 May 31st 06 10:11 AM
ActiveWorkbook.Protect password:=range("rangename") does not work WimR Excel Discussion (Misc queries) 1 June 26th 05 08:47 AM
How to crack "Protect Sheet" Password in Excel? Hardik Shah[_2_] Excel Programming 4 May 15th 05 02:23 PM
no password carryover with "protect sheet" in macro Trevor Shuttleworth Excel Programming 0 February 12th 04 09:44 PM


All times are GMT +1. The time now is 11:40 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"