Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Restore an invisible commandbutton on open?
You need to be more explicit in your referencing of the buttons. The on open
will be in a general module which by default will act upon the active sheet (whatever that might be at the time). Try something more like this... Sub Workbook_Open() Sheets("Sheet 1").button1.Visible = True Sheets("Sheet 1").button2.Visible = True Sheets("Sheet 1").Hide.Visible = True End Sub -- HTH... Jim Thomlinson "Mike Proffit" wrote: 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! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
CommandButton to open a Excel workbook | Excel Discussion (Misc queries) | |||
how to get commandbutton name | Excel Programming | |||
CommandButton in Excel to open another Application | Excel Worksheet Functions | |||
Commandbutton to Workbook Open | Excel Programming | |||
CommandButton | Excel Programming |