Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default sheet protection

Hi and thanks in advance,
I have this problem of unprotecting a sheet, allowing for certain
features and want to protect that with a password again. When I do
that, I am getting syntax error. Someone please help,

code:
Sub Macro4()
ActiveSheet.Unprotect Password:="hiacsc"

ActiveSheet.Protect Password:="hiacsc" DrawingObjects:=True, _
Contents:=True, Scenarios:=True , AllowFormattingCells:=True,
_
AllowFormatingColumns:=True, _
AllowFormattingRows:=True, AllowSorting:=True,
AllowFiltering:=True
ActiveSheet.EnableSelection = xlNoRestrictions
End Sub

If I omit Password for protecting the sheet it does what I want, but
when I protect that with Password atrribute, it is giving me syntax
error.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default sheet protection

Hi Nasir,

Try changing:

ActiveSheet.Protect Password:="hiacsc" DrawingObjects:=True, _


to

ActiveSheet.Protect Password:="hiacsc", DrawingObjects:=True, _


Note the comma after "hiacsc"


---
Regards,
Norman



wrote in message
ups.com...
Hi and thanks in advance,
I have this problem of unprotecting a sheet, allowing for certain
features and want to protect that with a password again. When I do
that, I am getting syntax error. Someone please help,

code:
Sub Macro4()
ActiveSheet.Unprotect Password:="hiacsc"

ActiveSheet.Protect Password:="hiacsc" DrawingObjects:=True, _
Contents:=True, Scenarios:=True , AllowFormattingCells:=True,
_
AllowFormatingColumns:=True, _
AllowFormattingRows:=True, AllowSorting:=True,
AllowFiltering:=True
ActiveSheet.EnableSelection = xlNoRestrictions
End Sub

If I omit Password for protecting the sheet it does what I want, but
when I protect that with Password atrribute, it is giving me syntax
error.



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
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
sheet Protection Bwells Excel Discussion (Misc queries) 2 August 31st 07 06:44 PM
Sheet protection on MAC Jim May Excel Discussion (Misc queries) 3 August 30th 07 12:56 AM
Sheet protection error msg - Unrequested sheet activation deltree[_3_] Excel Programming 0 January 28th 04 06:20 PM


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