Most valuable professional
  • Hot Topics

Excel Error When Open From Protected View

Good afternoon I've written a bit of code that when my workbook is opened, it makes sure a particular sheet is visible and then activated/selected. After it has done this, it makes sure all inactive sheets are marked as xlSheetVeryHidden. The code works fine when opened up from 'My Documents'... The issue I'm having is, all other users will be viewing a read only version, which is linked from an internal website. Opening from there has Excel open in protected view... When users click 'Enable Content', they get the following error message: Run-time error '1004': Method 'Activate' of object'_Worksheet' failed It doesn't stop my sheet from opening, and it seems to open at the correct page... Just it fails to bring up an important message box I want users to see when the document is opened. My code in the 'ThisWorkbook' module and is as follows: Code: Private Sub Workbook_Open() Application.ScreenUpdating = False Dim ws As Worksheet With Home .Visible = xlSheetVisible .Activate End With For Each ws In ThisWorkbook.Worksheets If ws.Name <> ThisWorkbook.ActiveSheet.Name ws.Visible = xlSheetVeryHidden End If Next ws

This question generated 10 answers. To proceed to the answers, click here.

This thread is current as of November 13, 2017.

For more resources for Microsoft Excel:

This article includes the following tags:

  • Excel
  • Microsoft Excel