View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
N E Body N E Body is offline
external usenet poster
 
Posts: 34
Default How do I delete my custom button on closing

Hello everyone

I use the following code to create a button and run a macro - the problem is
how do I delete it when I close the workbook

Any Ideas

Kenny

I am using

Sub MyButton()
Set MenuItem = Application.CommandBars("Worksheet Menu
Bar").Controls.Add(Type:= _
msoControlButton)
With MenuItem
.FaceId = 277
.OnAction = "MyPass"
End With
End Sub