Full protection of excel file

Closed
Trowa - Sep 14, 2009 at 08:35 AM
Excelguru Posts 261 Registration date Saturday April 11, 2009 Status Member Last seen June 21, 2011 - Sep 16, 2009 at 10:50 PM
Hello,

I want to fully protect my excel file so I have done the following:
Protect each worksheet with password.
Protect VBA project with password.
Protect workbook with password.

So far everything is fine.
But when I want to run macros the sheets can't be protected.
So I wrote a macro to disable and a macro to enable the protection.
Made a button which once clicked runs:
the macro to disable protection
the macro which I want to work
the macro to enable protection

Now I can run the macro and still have my file protected.
The problem is that now anyone can run the macro to disable the protection without knowing the password!

Does anyone know a solution for this?

Best regards,
Trowa
Related:

1 response

Excelguru Posts 261 Registration date Saturday April 11, 2009 Status Member Last seen June 21, 2011 307
Sep 16, 2009 at 10:50 PM
Hi
Just add your code to unprotect the sheet at the begining of your macro and the code to protect the sheet at the end of your macro.
0