Activate Sheet when workbook opens

bigck2

Board Regular
Joined
Feb 20, 2014
Messages
147
Hello,

I have a very simple piece of code. This is saved in 'ThisWorkbook':



Code:
Private Sub Workbook_Open()


    Worksheets("Home").Activate   


End Sub

Most of the time this works fine (on my machine).

However, I share this workbook with other people in my company via our company intranet - Jive.

Sometimes, depending on how the file is accessed by the user when the file is opened they may get a message saying, "Protected View - ...... Enable Editing"

If the user clicks the 'Enable Editing' button then they get the following VBA error:

"Run-time error '1004' Activate method of Worksheet class failed'.

Please let me know if you have any thoughts, on how I could get around this? I need the file to open to the 'Home" worksheet every time.

I tried doing a Workbook_BeforeClose event, but because the user doesn't really "Save" the file, they "Publish" the file to Jive this doesn't seem to work for me.

Thanks,

Chris
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.

Smitty

Legend
Joined
May 15, 2003
Messages
29,536
The open event will generally fail when the workbook is in Protected View. Once it's enabled and reopened it should fire. Is there any way to list the Jive location as a Trusted Location?
 
Upvote 0

Forum statistics

Threads
1,195,993
Messages
6,012,745
Members
441,724
Latest member
Aalbid

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
Top