DrawingObjects conflict with UserInterfaceOnly - E

2019-09-11 04:53发布

I am trying to secure a workbook using the UserInterfaceOnly function, which runs on Workbook_Open, and it's working great.

However, I recently learned that I have to allow people to paste a picture in to the worksheet, so I added DrawingObject:=False. This has resulted in the apparent effect of the worksheet being locked in name only, but allowing full edit on locked and unlocked cells.

Any ideas would be greatly appreciated.

Private Sub Workbook_Open()

  Sheets("Template").Protect Password:="", UserInterfaceOnly:=True, DrawingObjects:=False

End Sub

1条回答
做自己的国王
2楼-- · 2019-09-11 05:38

Did some playing around and found that adding Contents:=True is required to reset cell protections. Not sure if this is the ideal solution, but it worked. Not sure if leaving it as an answer or edit to my questions is preferable.

查看更多
登录 后发表回答