ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Open workbook (https://www.excelbanter.com/excel-discussion-misc-queries/177544-open-workbook.html)

capt

Open workbook
 
Is there anything wrong with this code?
When I open the workbook, it should activate sheet "menu", but I keep
getting a run-time error 57121 with application and object defined error with
it.

Private Sub Workbook_Open()
Worksheets("menu").Select
Worksheets("menu").CommandButton3.Visible = False
UserForm8.Show
End Sub

any ideas?
--
capt

Dave Peterson

Open workbook
 
You may want to search google for that error code. Maybe something will pop up
that can help.

But in the meantime, how about trying to qualify those worksheets:

Private Sub Workbook_Open()
me.Worksheets("menu").Select
me.Worksheets("menu").CommandButton3.Visible = False
UserForm8.Show
End Sub

capt wrote:

Is there anything wrong with this code?
When I open the workbook, it should activate sheet "menu", but I keep
getting a run-time error 57121 with application and object defined error with
it.

Private Sub Workbook_Open()
Worksheets("menu").Select
Worksheets("menu").CommandButton3.Visible = False
UserForm8.Show
End Sub

any ideas?
--
capt


--

Dave Peterson

capt

Open workbook
 
Thanks Dave that sorted the problem.
--
capt


"Dave Peterson" wrote:

You may want to search google for that error code. Maybe something will pop up
that can help.

But in the meantime, how about trying to qualify those worksheets:

Private Sub Workbook_Open()
me.Worksheets("menu").Select
me.Worksheets("menu").CommandButton3.Visible = False
UserForm8.Show
End Sub

capt wrote:

Is there anything wrong with this code?
When I open the workbook, it should activate sheet "menu", but I keep
getting a run-time error 57121 with application and object defined error with
it.

Private Sub Workbook_Open()
Worksheets("menu").Select
Worksheets("menu").CommandButton3.Visible = False
UserForm8.Show
End Sub

any ideas?
--
capt


--

Dave Peterson



All times are GMT +1. The time now is 08:52 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com