+ Reply to Thread
Results 1 to 2 of 2

Pivot Tables don't refresh in locked sheet

  1. #1
    Forum Contributor
    Join Date
    08-12-2019
    Location
    NYC
    MS-Off Ver
    2019
    Posts
    155

    Pivot Tables don't refresh in locked sheet

    Hi everyone,

    I'm having some issues trying to refresh a pivot table (via VBA) in a locked sheet. When locking all the sheets (also via VBA), I make sure to have the statements "UserInterfaceOnly:=True, AllowSorting:=True, AllowFiltering:=True, AllowUsingPivotTables:=True" . But when I try to refresh the pivot tables, I still get the following error message (the same on all sheets with a pivot):

    Please Login or Register  to view this content.
    To solve this issue, I tried unsharring the data cache of each pivot table by following this tutorial:
    https://support.microsoft.com/en-us/...7-9e3a4a05542b

    I know I was able to do so because when I run ?ActiveWorkbook.PivotCaches.Count, I do get 4 (the number of pivot tables in my workbook) instead of 1 before. However, I still get the same error message. Also, when I test with only one tab (i.e. all other tabs in the workbook are unlocked, except one that I'm testing), I still get the same error message.

    Any idea what else I need to do to solve the issue? Obviously I would like to avoid having to unlock any sheet (even with VBA) because I believeI should be able to refresh pivot in the background without unlocking anything.

    Thanks!
    Last edited by MagnusNovak; 01-23-2023 at 08:27 PM.

  2. #2
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,259

    Re: Pivot Tables don't refresh in locked sheet

    Just because you protect the sheet with the parameter UserInterfaceOnly=True, it still does not mean that with the code "with impunity" you can do anything. Unfortunately, if you refresh a pivot table in a given sheet, you have to unprotect the sheet before and protect it after the refresh. This is one of the few exceptions when you have to unprotect the sheet before performing a certain action.

    Artik

+ 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 locked Pivot Table from external data and lock again
    By Opust in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 06-24-2019, 06:25 PM
  2. Refresh pivottable with locked sheet
    By frneset in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-19-2019, 11:30 AM
  3. VBA - Refresh Pivot Table Data in Locked Worksheet
    By CSSI-Justin in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-17-2018, 08:04 AM
  4. Refresh Data Tables from Pivot Tables
    By JJones5 in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 09-15-2016, 03:12 PM
  5. VBA Refresh all does not refresh pivot tables
    By cmorten82 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-05-2016, 04:32 PM
  6. [SOLVED] Refresh pivot tables - "Error: Cannot update PT on protect sheet" (sheet not protexted)
    By BartSeli in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-15-2013, 11:13 AM
  7. Refresh Pivot in Locked Sheet?
    By Dark_Templar in forum Excel General
    Replies: 1
    Last Post: 06-05-2006, 01:37 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