ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Protecting & Unportecting the sheet. (https://www.excelbanter.com/excel-programming/415459-protecting-unportecting-sheet.html)

Heera

Protecting & Unportecting the sheet.
 
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


Mike H

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



Heera

Protecting & Unportecting the sheet.
 
Can you give me some more information to protect it strongly so that
users cannot do any thing.

Heera

Protecting & Unportecting the sheet.
 
I did as you said and its working fine....

Thank you for your co-opration.


Mike H

Protecting & Unportecting the sheet.
 
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

"Heera" wrote:

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


Heera

Protecting & Unportecting the sheet.
 
Thanks for you update.

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

Regards



All times are GMT +1. The time now is 09:00 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com