yaswanth92
Member
I am trying to protect a workbook using a macro. The macro activates the Userform which asks the user to put in the password. As soon as the user puts in the password, the hidden sheets of the workbook gets visible. I have written this macro in "This workbook" using Sub Workbook_open and Workbook_Close.
I am facing the following 2 issues currently:
1) The userform gets activated only after pressing "Enable content". Is there a way through which one can activate the userform without pressing the "Enable Content"? I don't want to manually change the "Trust Center" settings.
2) The macro needs to save the workbook before closing so that the sheets get hidden. I don't want to save the workbook before closing and still hide the all sheets except one sheet. Is there a way for this?
Thank you!
I am facing the following 2 issues currently:
1) The userform gets activated only after pressing "Enable content". Is there a way through which one can activate the userform without pressing the "Enable Content"? I don't want to manually change the "Trust Center" settings.
2) The macro needs to save the workbook before closing so that the sheets get hidden. I don't want to save the workbook before closing and still hide the all sheets except one sheet. Is there a way for this?
Thank you!