Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default password protect macro

How do I run a macro that will unprotect the sheet by entering the password,
run the macro, and then password protect the sheet again by re-entering the
password after the macro runs so users are not able to tamper with the data
in the spreadsheet?

I get an error when I try this with an actual password, but it works if I
protect the sheet without a password.

Thanks for your help.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default password protect macro

should work fine - see

ActiveSheet.Protect Password = "FRED"
ActiveSheet.Unprotect Password = "FRED"


which (rather pointlessly) protects and unprotects a sheet without
doing anything else

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default password protect macro

Thanks Aidan. It works, but for some reason when I try to unprotect the
worksheet from Excel and put in the password it's telling me that my password
is incorrect. When I run the macro which protects and unprotects the
worksheet with the password it works fine. Any thoughts?

"AidanH" wrote:

should work fine - see

ActiveSheet.Protect Password = "FRED"
ActiveSheet.Unprotect Password = "FRED"


which (rather pointlessly) protects and unprotects a sheet without
doing anything else


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default password protect macro

(AidanH replying from home!) - I would GUESS that the sheet is already
protected with a password different from the one you expect (perhaps CAPS
instead of caps - these are different to Excel you see)

"Modell" wrote in message
...
Thanks Aidan. It works, but for some reason when I try to unprotect the
worksheet from Excel and put in the password it's telling me that my

password
is incorrect. When I run the macro which protects and unprotects the
worksheet with the password it works fine. Any thoughts?

"AidanH" wrote:

should work fine - see

ActiveSheet.Protect Password = "FRED"
ActiveSheet.Unprotect Password = "FRED"


which (rather pointlessly) protects and unprotects a sheet without
doing anything else




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
Password Protect Macro? ryanmhess Excel Programming 4 January 27th 06 04:56 PM
Add protect worksheet password in macro Kelly Excel Worksheet Functions 1 January 10th 06 02:08 AM
Use macro to password protect macros Noah Excel Programming 3 October 30th 05 11:00 PM
Password protect macro Pete Excel Programming 2 April 16th 04 03:44 AM
Request password during Protect macro Gavin[_5_] Excel Programming 6 November 11th 03 12:54 PM


All times are GMT +1. The time now is 08:35 PM.

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

About Us

"It's about Microsoft Excel"