ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Macro Passwords (https://www.excelbanter.com/excel-discussion-misc-queries/218625-macro-passwords.html)

bmorgan8h

Macro Passwords
 
I have not been able to get my password protected spreadsheets to reapply the
password when I use a macro to unprotect the spreadsheet, perform a function,
and then attempt to reapply the password. I can reprotect the spreadsheet,
but it is without a password.

Can any help me understand what I am doing wrong. I really want to reapply
the password.

Mike H

Macro Passwords
 
Try this

ActiveSheet.Unprotect Password:="Mypass"
'do lots of things
ActiveSheet.Protect Password:="Mypass"


Mike

"bmorgan8h" wrote:

I have not been able to get my password protected spreadsheets to reapply the
password when I use a macro to unprotect the spreadsheet, perform a function,
and then attempt to reapply the password. I can reprotect the spreadsheet,
but it is without a password.

Can any help me understand what I am doing wrong. I really want to reapply
the password.


Lars-Åke Aspelin[_2_]

Macro Passwords
 
On Sat, 31 Jan 2009 13:33:00 -0800, bmorgan8h
wrote:

I have not been able to get my password protected spreadsheets to reapply the
password when I use a macro to unprotect the spreadsheet, perform a function,
and then attempt to reapply the password. I can reprotect the spreadsheet,
but it is without a password.

Can any help me understand what I am doing wrong. I really want to reapply
the password.


You have written something wrong in your code.

It is easier to help if you post the few code lines of your macro
where you try to protect the spreadsheet and it fails.

Lars-Åke


All times are GMT +1. The time now is 11:05 PM.

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