Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default Protecting sheet in a macro doesn't work

I have a macro that moves data from one sheet to another. It is necessary to
unprotect sheets during the data move, then re-protect them after. I protect
the sheets manually before running the macro, using the same password the
macro uses. But after the macro has run, I find I can unprotect the sheet by
hitting ToolsProtectionUnprotect sheet, and it does not ask for a password;
it goes ahead and unprotects the sheet. Prior to running the macro, it does
ask for the password before unprotecting the sheet. The macro definitely is
reprotecting with the same password. Need to solve this to protect formula
cells in one sheet, and data in the other. I've also tried not protecting
them manually at all, just letting the macro do it. Same result.

This is what I'm using in the macro:
ActiveSheet.Protect Password:="XXXXX"
ActiveSheet.Unprotect Password:="XXXXX"


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default Protecting sheet in a macro doesn't work


Hey, I fixed it. Bad syntax. No more problem. Thanks anyway & Happy New Year.
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
Macro for protecting sheet JoeP Excel Discussion (Misc queries) 2 November 27th 07 12:05 AM
Protecting sheet that has macro ub Excel Worksheet Functions 5 October 6th 07 12:37 AM
Macro not protecting every sheet Brad Excel Programming 7 March 14th 07 12:33 AM
why doesn't sort work when it's choosen before protecting sheet Mearll Excel Worksheet Functions 1 February 1st 06 07:32 PM
macro for Protecting a Sheet cincode5 Excel Discussion (Misc queries) 5 July 20th 05 11:59 AM


All times are GMT +1. The time now is 11:39 AM.

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"