Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default protect sheet macro - can't have it enter password

Simple problem I think.

I record a macro to protect a sheet and enter the password durin
recording. However, when I play the macro, the sheet is protected bu
it is not password protected. It can be unprotected without entering
password.

Why isn't the password part of the macro? And how do I get it in ther
????

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default protect sheet macro - can't have it enter password

Replace a line in your code that would be similar to this


To Protect an active sheet

ActiveSheet.Protect PASSWORD:="Password Phrase Here",
DrawingObjects:=True, Contents:=True, Scenarios:=True

To Unprotect an active sheet

ActiveSheet.Unprotect PASSWORD:="Password Phrase Here"


---
Message posted from http://www.ExcelForum.com/

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 550
Default protect sheet macro - can't have it enter password

inaz,

Why it doesn't record the password, I couldn't tell ya'
Go into the VBA editor and add the following to the recorded line:
, password:="yourpassword"

The whole line should read something like this:
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True,
password:="yourpassword"

John

"inaz " wrote in message
...
Simple problem I think.

I record a macro to protect a sheet and enter the password during
recording. However, when I play the macro, the sheet is protected but
it is not password protected. It can be unprotected without entering a
password.

Why isn't the password part of the macro? And how do I get it in there
?????


---
Message posted from http://www.ExcelForum.com/



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default protect sheet macro - can't have it enter password

Works great - Thanks alot :

--
Message posted from http://www.ExcelForum.com

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 550
Default protect sheet macro - can't have it enter password

inaz,

No problem.
Happy to have been a help.

John

"inaz " wrote in message
...
Works great - Thanks alot :D


---
Message posted from http://www.ExcelForum.com/



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 a sheet Joe Excel Discussion (Misc queries) 5 October 27th 08 11:14 PM
Macro to re-protect sheet w/ original password after pasting valuesin new book [email protected] Excel Worksheet Functions 1 June 4th 08 04:27 PM
Code to protect/unprotect a sheet using a macro with password FredH Excel Discussion (Misc queries) 5 October 23rd 07 04:49 PM
Protect sheet without password? EllenM Excel Discussion (Misc queries) 2 June 21st 07 03:22 PM
Password Protect a Sheet Lynn Excel Discussion (Misc queries) 1 October 27th 06 03:41 PM


All times are GMT +1. The time now is 07:47 AM.

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"