I have come across a strange problem in Microsoft Excel for Mac 16.11. It is equally true for Windows version too. If I copy some cell(s) and use VBA to protect or unprotect the sheet, the clipboard clears. Here is the code that I use for protect - unprotect :
Sheet1.Unprotect("abc")
Sheet1.Protect("abc")
But if I copy some cell(s) and use the UI i.e Review -> Protect, Unprotect, the clipboard is retained and I can even see that the dotted green coloured border across the copied cells is intact, unlike the former case.
I can use MSForms.DataObject to manually save the clipboard text(it works) before calling protect / unprotect and restore it after the call but then the dotted green coloured border goes away which can cause confusion to user.
Is there a way to imitate in VBA what the UI does when protecting /unprotecting ?
Sheet1.Protect: Selection.Copy
) or unprotecting:Sheet1.Unprotect: Selection.Copy
? – paul bica