Hello,
I am trying to run a very small macro in Excel97 that gets a value from a cell in one spreadsheet and uses that value to select the value in a pivot table in another sheet. I have used this same code many times and have had no problems with it, but now it is giving me a message "Run Time Error 1004: Unable to set the_Default property of PivotItem class".
Here is my code:
Sub update()
classCell = Worksheets("Class Report"
.Cells(1, 2)
Sheets("budget_pivot"
.Select
ActiveSheet.PivotTables("BudgetPivot"
.PivotFields("class"
.CurrentPage = classCell
Sheets("Class Report"
.Select
'ActiveWindow.SelectedSheets.PrintOut Copies:=1
ActiveWindow.SelectedSheets.PrintPreview
End Sub
Any thoughts will be greatly appreciated!
I am trying to run a very small macro in Excel97 that gets a value from a cell in one spreadsheet and uses that value to select the value in a pivot table in another sheet. I have used this same code many times and have had no problems with it, but now it is giving me a message "Run Time Error 1004: Unable to set the_Default property of PivotItem class".
Here is my code:
Sub update()
classCell = Worksheets("Class Report"
Sheets("budget_pivot"
ActiveSheet.PivotTables("BudgetPivot"
Sheets("Class Report"
'ActiveWindow.SelectedSheets.PrintOut Copies:=1
ActiveWindow.SelectedSheets.PrintPreview
End Sub
Any thoughts will be greatly appreciated!