Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default no password carryover with "protect sheet" in macro

Jeremy

you haven't actually provided a password:

From the Help:

Syntax 1

expression.Protect(Password, DrawingObjects, Contents, Scenarios,
UserInterfaceOnly)

Syntax 2

expression.Protect(Password, Structure, Windows)



So, you need to add something like:

ActiveSheet.Protect Password := "drowssap"Regards

Trevor


"Jeremy" wrote in message
...
I'm hoping to run a macro on a sheet of data and then have the newly

generated sheet be password protected against any alterations. While
recording a new macro, i go to "Sheet Protection..." and protect the sheet
using the optional password feature. This macro, when used later on, creates
a new sheet of data and the sheet is initially protected when trying to
alter a cell (gives the notificiation of "read-only" but also says the sheet
can be unprotected but a password may be required), but if i simply go to
"Unprotect Sheet..." it allows me to do so without entering a password.

The VBA language,

ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True

doesn't carryover the password for some reason.

any ideas?

Jeremy



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
Protect sheet unchecking "Select locked cells" has undesiredresults wal Excel Discussion (Misc queries) 1 September 1st 08 03:28 PM
Add "Protect ALL Sheets" that is the same as "Protect Sheet" KLLuoma Excel Worksheet Functions 0 July 27th 06 07:55 PM
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
Can I protect columns w/in a "List" using Protect Sheet? Diane Excel Discussion (Misc queries) 0 May 10th 06 03:30 PM


All times are GMT +1. The time now is 07:07 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"