View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Mike Proffit Mike Proffit is offline
external usenet poster
 
Posts: 4
Default Restore an invisible commandbutton on open?

Hi All. I've got a spreadsheet with a couple of command buttons that launch
vba prcedures. After the user does their stuff, I want a third button that
will hide all three buttons. I've got that part down:

Private Sub Hide_Click()
button1.Visible = False
button2.Visible = False
Hide.Visible = False
End Sub

But I want those three buttons to reappear when the workbook is opened. I've
got an auto-run macro in ThisWorkbook:

Sub Workbook_Open()
button1.Visible = True
button2.Visible = True
Hide.Visible = True
End Sub

On opening the workbook, I get Run-time error '424': Object required.

If I go into design mode, The buttons do appear and I can manually make them
visible again by making their visible property = true. Just want that
automated.

Thanks for any help!