A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
1) That's what I thought. You ARE protecting during the file open code.
2) If you can protect all the sheets, save them in the protected state, and take out the ProtectWorksheets code, the file should open fast.
1) Yes, you are right about that.
2) You are right about that also. I protected programmatically, saved and commented out the reference to the ProtectWorksheets code. The file opens instantly.
However, there's one big inconvenience: I get many "Error 1004 during execution" messages after clicking command buttons: "The cell or chart you are trying to change is on a protected worksheet."
I didn't get those errors when protection was created during the file open code, due to "UserInterfaceOnly:=True" included in the protection code. Unfortunately this is not working anymore after saving the sheets in the protection state and taking out the protection code. To have UserinterfaceOnly:=True working obviously one has to protect the worksheets each time during the file open. Or do you know another way to achieve the same result, i.e. to avoid those "Error 1004" messages?
Best regards
Jacques