LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default Sheet Protection doesn't hold

I have to unprotect sheets during a macro, move some data, then reprotect.
I'm using an 8 character password. Before running the macro,
ToolsProtectionUnprotect sheet prompts for the password. But after running
the macro (and remember the macro does reprotect with the 8 character
password), it is protected, but ToolsProtectionUnprotect sheet unprotects
it without requiring a password.

I need the formulas and macro code to be inaccessible to users. Is there
some syntax I need to add to make this happen? It seems like the
protect/unprotect in VBA is somehow separate from the protect/unprotect in
the workbook itself. Here's what I'm using:

ActiveSheet.Unprotect Password:="xxxxxxxx"

'data manipulations

ActiveSheet.Protect Password:="xxxxxxxx", DrawingObjects:=True,
Contents:=True, Scenarios:=True
 
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
Excel Data Protection Best Practice: AKA: Real Sheet Protection Mushman(Woof!)[_2_] Excel Discussion (Misc queries) 4 December 30th 09 01:20 AM
Excel Data Protection- AKA: Sheet/Macro Password Protection Mushman(Woof!) Setting up and Configuration of Excel 0 December 29th 09 06:50 AM
How to find and Replace hyperlink in hold sheet? Wiparat Excel Discussion (Misc queries) 1 August 5th 07 11:40 AM
How can I hold every other row color on a sheet when I sort Proto Excel Discussion (Misc queries) 1 September 28th 06 12:52 PM
Hold closing the sheet... Sridhar Pentlavalli via OfficeKB.com Excel Programming 2 December 29th 04 02:32 PM


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