I have a pivot table in a secured sheet, is it possible to automatically update that pivot table when a secure tab is opened?
Thank you !
I have a pivot table in a secured sheet, is it possible to automatically update that pivot table when a secure tab is opened?
Thank you !
In the work sheet module for the tab you are opening, put the following code and change the sheet name and pivot table name as indicated.
![]()
Please Login or Register to view this content.
One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.
A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.
Thank you,
Yes, this works if the tab is not protected, but the tab is protected with password "koss"
The protection must first be automatically bypassed and then the protection must be reset.
Is it possible?
thanks,
Koen
Add this to the code
![]()
Please Login or Register to view this content.
like this? it doesn't work:
Private Sub Worksheet_Activate()
Sheets("Zoekfuncties").PivotTables("Draaitabel1").PivotCache.Refresh
Sheets("Zoekfuncties").Protect userinterfaceonly:=True
End Sub
i'm sorry, I am a beginner who tries something
Put the statements in the other order
![]()
Please Login or Register to view this content.
ok, thanks, but...
I get a msgbox where I have to enter the password and the user of the file will not know the password.
I should have caught that you were doing this in a worksheet module. You could use ActiveWorksheet instead of naming the sheet. However, explicitly naming the sheet is never wrong and a good habit to get into.
I had to learn this one myself since I've never done it on a password protected sheet.
![]()
Please Login or Register to view this content.
when I open the secured tab, I get an error message that I can not edit a PivotTable in a secured sheet.
there is a yellow line in the code:
Sheets("Zoekfuncties").PivotTables("Draaitabel1").PivotCache.Refresh
ScreenShot 26-02-2019 -- 20 21 54.jpg
I duplicated your exact scenario, according to the articles on line the code is supposed to work.
Here is an inefficient, but works version of the code
![]()
Please Login or Register to view this content.
I went out to this board with the question and they came up with
![]()
Please Login or Register to view this content.
hello,
it works !!
you are the best, i'm very happy!!
thank you!!!!
I learned something too!![]()
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks