ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Passwords in macros (https://www.excelbanter.com/excel-worksheet-functions/115824-passwords-macros.html)

Julian Glass

Passwords in macros
 
I have recorded which protects worksheets and the workbook with passwords.
The macro is stored in the Personal workbook. When I run the macro against
another workbook it runs ok but the passwords aren't embedded.

What have or done wrong or is this not possible. Looking at the the VB there
is no ref to password or encrypted data there.

Thanks



Paul B

Passwords in macros
 
Julian, use something like this,

ActiveSheet.Protect Password:="123", DrawingObjects:=True,
Contents:=True, Scenarios:=True
ActiveWorkbook.Protect Password:="123", Structu=True, Windows:=False

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

"Julian Glass" wrote in message
. uk...
I have recorded which protects worksheets and the workbook with passwords.
The macro is stored in the Personal workbook. When I run the macro against
another workbook it runs ok but the passwords aren't embedded.

What have or done wrong or is this not possible. Looking at the the VB

there
is no ref to password or encrypted data there.

Thanks






All times are GMT +1. The time now is 07:19 PM.

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