Hi Im trying to make a pop up box automatically bring itself up when opening excel so i can unprotect all the worksheets in one go.
Im using the below code to automatically Protect all my worksheets when i close the excel, but want something that prompts a password when re-opening.
I would just normally lock the file in the Save As, Tools etc option but the file is part of a sharepoint and this way really mucks up the file.
I need a macro to help with this issue.
Private Sub Workbook_BeforeClose(Cancel As Boolean)
'Update by Extendoffice 2018/1/24
Dim xSheet As Worksheet
Dim xPsw As String
xPsw = "PASSWORD"
For Each xSheet In Worksheets
xSheet.Protect xPsw
Next
End Sub
Im using the below code to automatically Protect all my worksheets when i close the excel, but want something that prompts a password when re-opening.
I would just normally lock the file in the Save As, Tools etc option but the file is part of a sharepoint and this way really mucks up the file.
I need a macro to help with this issue.
Private Sub Workbook_BeforeClose(Cancel As Boolean)
'Update by Extendoffice 2018/1/24
Dim xSheet As Worksheet
Dim xPsw As String
xPsw = "PASSWORD"
For Each xSheet In Worksheets
xSheet.Protect xPsw
Next
End Sub