I have protected a sheet using:
When I click a button that runs the following macro, it works:
When I make a worksheet change which triggers the following sequence:
Then I get the attached error message on the line Sheet1.Unprotect. I tried adding Application.DisplayAlerts = False before unprotecting. But then the macro stopped already on Application.DisplayAlerts = False and the popup appeared. If I tell the macro to continue, it continues and finishes successfully despite the popup.
Why does this popup appear?
Run time error.png
PS. I can't upload the workbook as is because it contains lot's of company data. If I remove everything from the workbook, I don't get an error message any more when running the exact same macro. I don't know why.
Bookmarks