i've been trying disable or remove paste special options excel 2013 right-click popup menu , can't find way.
i have removed 'paste options' excel file->options->advanced->cut copy , paste, has no effect on right button click 'paste options'.
i have tried vba code, appears control id has changed.
sub deactivatecollagespecial() dim ctrl office.commandbarcontrol each ctrl in application.commandbars.findcontrols(id:=755) ctrl.enabled = false next ctrl end sub
thanks help.
i used code list candidates paste special control:
private sub listpastecontrols() each ctrl in application.commandbars.findcontrols() if lcase(ctrl.caption) "*paste*" debug.print ctrl.caption & " - " & ctrl.id end if next end sub
which gave output me (duplicates removed):
&paste - 6002 &paste - 22 paste &special... - 21437 &paste table - 3624 paste li&nk - 1956 paste &special... - 755 paste &hyperlink - 2787 &paste... - 879
leading me id 21437. when tried disabling controls using code, context menu version of "paste special..." became greyed-out desired. looking through of parents of these controls, think should disable sorts of cases hadn't thought of, right-clicking on full row/column instead of cell/range - without undesired consequences identify.
Comments
Post a Comment