Automatically go to Worksheet upon opening

Toonloon

Board Regular
Joined
Dec 13, 2005
Messages
98
Hi All...

Upon opening, I want my Workbook to automatically go to a worksheet titled "Main Menu".

This workbook is shared out to multiple users.

The code i currently have in "ThisWorkbook" object is:
Private Sub Workbook_Open()
Sheets("Main Menu").Activate
Sheets("Main Menu").Range("A1").Activate
End Sub


This works, however, users are intermittently getting the error
"Run Time Error '1004'
Select method of Range class failed"


Any ideas/suggestions ?

Thanks a million.
 
Try

Rich (BB code):
Private Sub Workbook_Open()
Application.Goto Sheets("Main Menu").Range("A1"), True
ActiveSheet.Unprotect password:="abc"
Call PivotSec1
ActiveSheet.Protect password:="abc"
End Sub

Change abc to the password (twice).
 
Upvote 0

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
I managed to bypass the one error message by combining 2 of your suggestions:

Code:
Private Sub Workbook_Open()
On Error Resume Next
Application.Goto Sheets("Results").Range("A1"), True
ActiveSheet.Unprotect Password:="Password"
Call PivotSec1
ActiveSheet.Protect Password:="Password"
On Error GoTo 0
End Sub

However it's now bringing up the following message:

"Cannot edit PivotTable on protected sheet"

Which means that the macro isnt working properly... here is the code for the macro...

Code:
Sub PivotSec1()
'
' PivotSec1 Macro
'
'
    ActiveSheet.Unprotect
    ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _
        , AllowUsingPivotTables:=True
End Sub

Thanks for all of your help with this - still new to VBA so this is all a bit confusing!!!

:)
 
Upvote 0
If that is all the code in PivotSec1 then I cannot understand why it generates an error.
 
Upvote 0
It's really frustrating, because when protecting the sheet I select the option "Use PivotTable reports" but whenever I reopen the file after saving the sheet is still password protected but this option is no longer selected...:(
 
Upvote 0
Maybe start a new thread from this as it is now a different problem to the post title.
 
Upvote 0

Forum statistics

Threads
1,224,564
Messages
6,179,543
Members
452,924
Latest member
JackiG

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top