Hi,
I have a macro to add a new worksheet template to a workbook. However, if the workbook is protected, an error occurs. How can I check if an opened workbook is protected? I have tried workbook.haspassword and workbook.password but they don't correspond to the protection of the workbook. I have some workbooks that are protected but workbook.haspassword returns false; I have some workbooks that are not protected but workbook.password returns an actual string. Thanks.
I have a macro to add a new worksheet template to a workbook. However, if the workbook is protected, an error occurs. How can I check if an opened workbook is protected? I have tried workbook.haspassword and workbook.password but they don't correspond to the protection of the workbook. I have some workbooks that are protected but workbook.haspassword returns false; I have some workbooks that are not protected but workbook.password returns an actual string. Thanks.