ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro to protect with pword in 97 (https://www.excelbanter.com/excel-programming/277060-macro-protect-pword-97-a.html)

Wes[_4_]

Macro to protect with pword in 97
 
I've coded in excel xp, but it does not work if I open it
in excel 97. The code unprotects a page with a passowrd,
changes some things, then protects it again. The code to
protect I used was:

Worksheets("Student List").Unprotect Pword
.... some code ...
Worksheets("Student List").Protect password:=Pword

(Where Pword is a string constant)

What do I need to change so that it works in 97?

Thanks for any help you can give me.


Tom Ogilvy

Macro to protect with pword in 97
 
If you are running it from a comandbutton, then change the TakeFocusOnClick
property to False.

--
Regards,
Tom Ogilvy

"Wes" wrote in message
...
I've coded in excel xp, but it does not work if I open it
in excel 97. The code unprotects a page with a passowrd,
changes some things, then protects it again. The code to
protect I used was:

Worksheets("Student List").Unprotect Pword
... some code ...
Worksheets("Student List").Protect password:=Pword

(Where Pword is a string constant)

What do I need to change so that it works in 97?

Thanks for any help you can give me.





All times are GMT +1. The time now is 12:53 PM.

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