Reputation: 1276
When I use (some code here).copy destination:=(some code there)
. It will still prompt for protection issues on cells
. Basically it just won't let my code runs.
Upvotes: 2
Views: 9882
Reputation: 2761
I posted one approach to solving this here: https://stackoverflow.com/a/69730040/13307304
Like Peter Albert mentioned, the password itself should not be hardcoded
Upvotes: 0
Reputation: 17475
The status UserInterfaceOnly:=TRUE
is unfortunately not stored in the file - therefore, if you reopen the file, it will be fully protected. Either use the Workbook_Open
event to reapply this protection status - or unprotect and then reprotect the worksheet in your VBA code directly.
See Ozgrid for further details!
Upvotes: 14