D
Doug Glancy
Is there any way to disable custom buttons durning cell editing, as occurs
with builtin buttons? I found an old post from Tom Ogilvy suggesting to
copy a builtin button and then reassign the onaction, caption, etc.
However, it seems that assigning a new onaction loses the trait of graying
out during cell edit. Here's the code I tried:
Sub test()
Dim cbar As CommandBarPopup
Dim ctl As CommandBarControl
On Error Resume Next
CommandBars(1).Controls("test").Delete
On Error GoTo 0
Set cbar = CommandBars(1).Controls.Add(Type:=msoControlPopup,
temporary:=True)
cbar.Caption = "test"
Set ctl = cbar.Controls.Add(ID:=757) 'Edit --> Go To button
With ctl
.Caption = "tester"
.OnAction = "tester"
End With
End Sub
Sub tester()
MsgBox "test"
End Sub
Thanks,
Doug
with builtin buttons? I found an old post from Tom Ogilvy suggesting to
copy a builtin button and then reassign the onaction, caption, etc.
However, it seems that assigning a new onaction loses the trait of graying
out during cell edit. Here's the code I tried:
Sub test()
Dim cbar As CommandBarPopup
Dim ctl As CommandBarControl
On Error Resume Next
CommandBars(1).Controls("test").Delete
On Error GoTo 0
Set cbar = CommandBars(1).Controls.Add(Type:=msoControlPopup,
temporary:=True)
cbar.Caption = "test"
Set ctl = cbar.Controls.Add(ID:=757) 'Edit --> Go To button
With ctl
.Caption = "tester"
.OnAction = "tester"
End With
End Sub
Sub tester()
MsgBox "test"
End Sub
Thanks,
Doug