Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Greetings,
I am attempting to turn one CommandButton visible and to make another one not visible when I open my workbook. What I am getting is a Visual Basic error message: Run-time error '424' Object required This is what I tried in "ThisWorkbook" (the * is the line highlighted by Debug): Private Sub Workbook_Open() Sheets("Enter").Select * CommandButton1,Visible = True CommandButton2,Visible = False Range("AP2").Select End Sub Anyone see what is wrong with code? Any help would be most appreciated. TIA -Minitman |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You need a dot instead of a ,
CommandButton1.Visible -- Regards Ron de Bruin http://www.rondebruin.nl "Minitman" wrote in message ... Greetings, I am attempting to turn one CommandButton visible and to make another one not visible when I open my workbook. What I am getting is a Visual Basic error message: Run-time error '424' Object required This is what I tried in "ThisWorkbook" (the * is the line highlighted by Debug): Private Sub Workbook_Open() Sheets("Enter").Select * CommandButton1,Visible = True CommandButton2,Visible = False Range("AP2").Select End Sub Anyone see what is wrong with code? Any help would be most appreciated. TIA -Minitman |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
Sheets("Enter").Activate ActiveSheet.CommandButton1.Visible = True ActiveSheet.CommandButton2.Visible = False Range("AP2").Select Slawek(Poland) Uzytkownik "Minitman" napisal w wiadomosci ... Greetings, I am attempting to turn one CommandButton visible and to make another one not visible when I open my workbook. What I am getting is a Visual Basic error message: Run-time error '424' Object required This is what I tried in "ThisWorkbook" (the * is the line highlighted by Debug): Private Sub Workbook_Open() Sheets("Enter").Select * CommandButton1,Visible = True CommandButton2,Visible = False Range("AP2").Select End Sub Anyone see what is wrong with code? Any help would be most appreciated. TIA -Minitman |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You need a dot separator not comma, and you have to qualify the button with
the sheet Private Sub Workbook_Open() Sheets("Enter").Select ActiveSheet.CommandButton1.Visible = True ActiveSheet.CommandButton2.Visible = False Range("AP2").Select End Sub or Private Sub Workbook_Open() With Sheets("Enter"). .Activate .CommandButton1.Visible = True .CommandButton2.Visible = False .Range("AP2").Select End With End Sub -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Minitman" wrote in message ... Greetings, I am attempting to turn one CommandButton visible and to make another one not visible when I open my workbook. What I am getting is a Visual Basic error message: Run-time error '424' Object required This is what I tried in "ThisWorkbook" (the * is the line highlighted by Debug): Private Sub Workbook_Open() Sheets("Enter").Select * CommandButton1,Visible = True CommandButton2,Visible = False Range("AP2").Select End Sub Anyone see what is wrong with code? Any help would be most appreciated. TIA -Minitman |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hey Ron,
Good catch on the typo. That, however, is not the problem (I typed the code rather then copied). Do you see any other possibilities? On Fri, 2 Apr 2004 20:25:59 +0200, "Ron de Bruin" wrote: You need a dot instead of a , CommandButton1.Visible |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you Slawek and Bob.
That is just what was missing. -Minitman On Fri, 02 Apr 2004 12:54:32 -0600, Minitman wrote: Hey Ron, Good catch on the typo. That, however, is not the problem (I typed the code rather then copied). Do you see any other possibilities? On Fri, 2 Apr 2004 20:25:59 +0200, "Ron de Bruin" wrote: You need a dot instead of a , CommandButton1.Visible |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Workbook_Open() Event | Excel Discussion (Misc queries) | |||
Workbook_Open () | Excel Discussion (Misc queries) | |||
Workbook_Open Event | Excel Programming | |||
WorkBook_Open Event | Excel Programming | |||
Workbook_Open() error | Excel Programming |