ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   password protect project with VBA code (https://www.excelbanter.com/excel-programming/321640-password-protect-project-vba-code.html)

Paulm

password protect project with VBA code
 
Hi All.
For Ex03, how do I password protect the project from within the VBA code?

I can't find the equivalent coding I've used for protecting a workbook, or a
worksheet.


I have 2 workbooks, Workbook1, and Workbook2.
Using code running in Workbook1, a module in Workbook1 is copied into
Workbook2. After the copy I want to password protect the VBE in Workbook2.
How do I do it? Do I have to do a Save As... of Workbook2?
Thank you for looking at my posting.
Paul

Chip Pearson

password protect project with VBA code
 
The object model does not support this. You MIGHT be able to use
SendKeys to send the appropriate keystrokes, but I wouldn't count
on it.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"PaulM" wrote in message
...
Hi All.
For Ex03, how do I password protect the project from within the
VBA code?

I can't find the equivalent coding I've used for protecting a
workbook, or a
worksheet.


I have 2 workbooks, Workbook1, and Workbook2.
Using code running in Workbook1, a module in Workbook1 is
copied into
Workbook2. After the copy I want to password protect the VBE
in Workbook2.
How do I do it? Do I have to do a Save As... of Workbook2?
Thank you for looking at my posting.
Paul





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

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