K
Kent McPherson
I'd like to add an item to the Tools menu when I open a spreadsheet and then
delete it before the workbook closes. I've tried adding this code to the
Workbook Open event.
Private Sub Workbook_Open()
CommandBars("Worksheet men
bar").Controls("Tools").Controls.Add(Type:=msoControlButton).Caption="MyMenu"
End Sub
When I open the spreadsheet, I get an error 91: Object Variable or With
block variable not set.
This same codes works if I include it in the code I have for a userform I've
defined to take inputs from the user.
Ideas?
delete it before the workbook closes. I've tried adding this code to the
Workbook Open event.
Private Sub Workbook_Open()
CommandBars("Worksheet men
bar").Controls("Tools").Controls.Add(Type:=msoControlButton).Caption="MyMenu"
End Sub
When I open the spreadsheet, I get an error 91: Object Variable or With
block variable not set.
This same codes works if I include it in the code I have for a userform I've
defined to take inputs from the user.
Ideas?