Error

  • Thread starter Thread starter mika.
  • Start date Start date
M

mika.

I want to hide the insert and format menu items when i
begin my program and make them visible again before i
close. This is my code for hiding them on open:

Private Sub Workbook_Open()
CommandBars("Worksheet Menu Bar").Controls
("Format").Visible = False
CommandBars("Worksheet Menu Bar").Controls
("Insert").Visible = False
End Sub

....but I'm getting Run-time error '91': Object variable or
With block variable not set. Any ideas as to why?

Thanks, mika.
 
Back
Top