ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Exit Sub is workbook is not protected (https://www.excelbanter.com/excel-programming/355353-exit-sub-workbook-not-protected.html)

ALEX

Exit Sub is workbook is not protected
 
In VBA, how do I write a line the exits sub if the active workbook is not
protected? Thanks

GS

Exit Sub is workbook is not protected
 
Hi Alex,

If Not ActiveWorkbook.ProtectStructure Then Exit Sub

Regards,
GS



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

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