+ Reply to Thread
Results 1 to 1 of 1

Refresh Pivot Table Connected to Protected Sheet

  1. #1
    Forum Contributor
    Join Date
    06-04-2015
    Location
    Bangkok, Thailand
    MS-Off Ver
    2013
    Posts
    175

    Refresh Pivot Table Connected to Protected Sheet

    Hi All,

    I have a worksheet that has pivot tables on a few different tabs using the same data source.

    I ran into the error of "cannot refresh" because some of the sheets are password protected.

    I am using the following code right now to be able to refresh the pivot tables while locking the worksheets again.

    Sub UnprotectRefreshAll()
    Dim ws As Worksheet
    On Error Resume Next

    For Each ws In ActiveWorkbook.Worksheets
    ws.Unprotect Password:="12345"
    Next ws

    ActiveWorkbook.RefreshAll

    For Each ws In ActiveWorkbook.Worksheets
    ws.Protect Password:="12345", _
    AllowUsingPivotTables:=True
    Next ws

    End Sub


    The problem with this is that in the protected worksheets I don't want to lock the cells, I just want to hide them. Also I want to allow users in the locked sheets to be able to do everything, i.e. under protect sheet they have select columns, delete rows, insert hyperlinks etc. I would like all of these to be selected.

    Basically I want to allow user the full functionality of the worksheet but hide the formulas.

    Also just noticed that using this code will protect all my sheets. I just want to protect a few sheets instead of all of them.

    Any help would be fully appreciated thank you.
    Last edited by tryingtoexcelatexcel; 06-25-2017 at 10:46 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Refresh Pivot Table in protected sheet
    By bgrish3 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-27-2016, 02:05 PM
  2. Automatic refresh pivot table on protected sheet
    By wrybel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-08-2014, 09:44 AM
  3. How to refresh Pivot table when sheet is protected?
    By vjharry in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-17-2013, 12:09 AM
  4. Refresh in Protected Pivot table
    By vjharry in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 05-16-2013, 01:08 AM
  5. Replies: 1
    Last Post: 09-18-2012, 04:10 PM
  6. Macro to Allow Refresh of a Pivot Table in a Protected Sheet
    By gavin0311 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-07-2011, 02:32 PM
  7. Pivot table refresh in a protected sheet
    By JoelMessing in forum Excel General
    Replies: 5
    Last Post: 05-04-2009, 02:56 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1