Protecting & Unportecting the sheet.

H

Heera

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
 
M

Mike H

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
 
H

Heera

Can you give me some more information to protect it strongly so that
users cannot do any thing.
 
M

Mike H

Hi,

There is no way to protect a worksheet or VB code that can withstand even a
slightly determined attack. This type of protection is to prevent accidental
deletions or to deter the casual fiddler. If you looking for security, Excel
can't provide it

Mike
 
H

Heera

Thanks for you update.

How can i hide my VBA codes so that no one can see the script.

Regards
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top