ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Pivot Table not valid error message when formatting data 'button'. (https://www.excelbanter.com/excel-discussion-misc-queries/10215-pivot-table-not-valid-error-message-when-formatting-data-button.html)

MDW

Pivot Table not valid error message when formatting data 'button'.
 
Created Pivot table/chart, password-protected and put onto website (ie NOt
saved file as Web Page). Click on link, get warning message concerning macros
and prompted for password. If attempt to change data button by rightclicking
on it and selecting format - get error message 'Pivot Table not valid'. Note,
accessing the file directly (ie not via the web) works perfectly Ok.

PS Also get visual basic error message ' Run time error 1004 :Unable to set
the default property of the Pivotitem class'

VB code

Sub All_Years()
CP = "(All)"
pf = "Year First Seen"
Call DeleteOldItemsWB 'this runs OK'
Call Hosp(CP, pf) 'this stops at line 3'
Call Tumour(CP, pf)
End Sub

Public Sub Hosp(X, Y)
Sheets("Hospital Chart").Select
ActiveChart.PivotLayout.PivotFields(Y).CurrentPage = X ' line 3'
Sheets("Home").Select
End Sub



All times are GMT +1. The time now is 08:09 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com