Full protection of excel file [Closed]

Report
-
Posts
261
Registration date
Saturday April 11, 2009
Status
Member
Last seen
June 21, 2011
-
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

1 reply

Posts
261
Registration date
Saturday April 11, 2009
Status
Member
Last seen
June 21, 2011
307
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.