I have a sheet protected with a password (not in the VBA-code but in the menu of Excel: Review > Protect sheet).
I don't want the password in the VBA-code. When you open a .xlsm workbook in OpenOffice you can see the entire code, and so also the password. Even when the VBA-code is protected with a password in Microsoft Excel.
When the protection is active the user is allowed to select locked and unlocked cells. Selecting unlocked cells is to give the user the possibility to copy the cell content.
In the VBA-code I have this line of code in Workbook_open():
So not with the password, for that is already set on the sheet (Review > Protect sheet).
Now, when the workbook is opened a prompt asks for the password for the sheet. But I don't want that to happen. For the password is already set in the menu.
When I change the protection in Review > Protect sheet, so the user can only select unlocked cells then there is no prompt for the password.
Is there a some VBA-code so that you can protect the sheet in the menu and that the user can select both locked and unlocked cells without the prompt for the password?
And the userinterfaceonly:=True in Workbook_open().
Who has the solution for this or knows how to fix this.