A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
I added that to my code and I'm still getting the error when I protect the sheet
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Trying to use a refresh button for a pivot table, but I need to protect the worksheet. Currently, when I protect the worksheet, the button comes back as a run-time error 1004. The button works fine when the sheet is unprotected.
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.
Comments have been turned off. Learn more
I added that to my code and I'm still getting the error when I protect the sheet
This page should help you:
https://docs.microsoft.com/en-us/office/vba/api...
If you have a password, you'll need to add it.
I do have VBA code in it
Sub Button5_Click()
ActiveSheet.PivotTables(2).PivotCache.Refresh
End Sub
what would I need to add to it? Thanks!
Do you have VBA code in the button? You'll need to add to it to unprotect the sheet, then refresh and then protect it afterwards.