View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Protecting & Unportecting the sheet.


Try,

Sheets("Key Analysis").UnProtect Password:="Mypass"
'do something
Sheets("Key Analysis").Protect Password:="Mypass"

That will get around asking for the password but it provides only minimal
security. If your clients want to remove the pasword they could do so very
easily with a simple google search for 'Remove Excel passwords'.

Mike

"Heera" wrote:

Hi,

I have writen a macro and the report goes to my clients.

While running the macro the sheets should get unprotected & once is
procedure is done it should get protected again.

Here is my problem.

Code
'Sheets("Key Analysis").Unprotect
'Sheets("Additional Analyis").Unprotect

While unprotecting it is asking for a password which I dont want to
give to the clients


'Sheets("Key Analysis").Protect DrawingObjects:=True, Contents:=True,
Scenarios:=True
'Sheets("Additional Analyis").Protect DrawingObjects:=True,
Contents:=True, Scenarios:=True

While protecting it is not asking for a password it is smply
proctecting it without password.

Please help
Heera