ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Protect VBA Project By Macro (https://www.excelbanter.com/excel-programming/416962-protect-vba-project-macro.html)

K[_2_]

Protect VBA Project By Macro
 
Hi all, I am looking for macro with which i can password protect
other Workbooks VBA Projects. I know you can do it by sendkeys but
can please anyone know what will be the full macro code if i want to
protect VBA Project of some other Workbook. Like if i click button
from Workbook A then it should protect VBA Project of Workbook B.

sameoldcalvin

Protect VBA Project By Macro
 
you could try the following:

so when you click button from workbook A....

Workbooks.Open Filename:= "C:\workbookB.xls"
ActiveWorkbook.Protect Structu=True, Windows:=False
ActiveWorkbook.Save
ActiveWindow.Close


All times are GMT +1. The time now is 12:01 AM.

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