K
Kasama
Shouldn’t ‘UserInterfaceOnly:=True’ allow macros to change the sheet?
My worksheet has a Shape which moves to align with Column V when a macro is
run. It works while the sheet is unprotected but when it’s protected, the
macro fails (Run-time error 1004) even though protection was set for User
Interface Only.
The 'Protect' macro uses this code:
Sheets("Name").Protect Password:="password", UserInterfaceOnly:=True,
Contents:=True, DrawingObjects:=True
The 'Move' macro which aligns the drawing object selects it and uses this
code:
Selection.Left = .Columns("V").Left
I know I could add code at the beginning and end of ‘Move’ to Unprotect and
Protect the sheet, but I thought that with ‘UserInterfaceOnly:=True’, I
should not need to do this?
My worksheet has a Shape which moves to align with Column V when a macro is
run. It works while the sheet is unprotected but when it’s protected, the
macro fails (Run-time error 1004) even though protection was set for User
Interface Only.
The 'Protect' macro uses this code:
Sheets("Name").Protect Password:="password", UserInterfaceOnly:=True,
Contents:=True, DrawingObjects:=True
The 'Move' macro which aligns the drawing object selects it and uses this
code:
Selection.Left = .Columns("V").Left
I know I could add code at the beginning and end of ‘Move’ to Unprotect and
Protect the sheet, but I thought that with ‘UserInterfaceOnly:=True’, I
should not need to do this?