Anthony G.
Active Member
- Joined
- Mar 24, 2002
- Messages
- 465
Hello to All…
Upon opening an existing file, I receive the following error: Unable to Read File….I then click OK, Enable the macros and upon doing so, the following message appears: Excel Table Report on [Sales] Sheet1 was discarded due to integrity problems.
I have two Pivot tables on the report – Pivot8 and Pivot1 – two separate worksheets but using the same source data. I have placed a button on each worksheet to enable the user to refresh the Pivot Table. Pivot1 is the table that is being discarded and when I click the button on Sheet1, the following Run time error 1004 appears: Unable to get the Pivot Tables property of the Worksheet class….when I select Debug, here’s the code with the bolded section being the point of error:
ActiveSheet.Unprotect Password:="test"
Range("K9").Select
ActiveCell.FormulaR1C1 = "=NOW()"
Range("K9").Select
Selection.Copy
Range("K9").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("h161").Select
ActiveSheet.PivotTables("PivotTable1").PivotCache.Refresh
ActiveWorkbook.ShowPivotTableFieldList = False
Columns("I:I").Select
Selection.ColumnWidth = 14.86
Range("A19").Select
ActiveSheet.Protect Password:="test"
End Sub
I guess I understand why I’m getting the Run time error (because the PT no longer exists); question is, why is it being discarded in the first place…?!?
Any assistance in correcting this will be greatly appreciated.
Thank you…Anthony
Upon opening an existing file, I receive the following error: Unable to Read File….I then click OK, Enable the macros and upon doing so, the following message appears: Excel Table Report on [Sales] Sheet1 was discarded due to integrity problems.
I have two Pivot tables on the report – Pivot8 and Pivot1 – two separate worksheets but using the same source data. I have placed a button on each worksheet to enable the user to refresh the Pivot Table. Pivot1 is the table that is being discarded and when I click the button on Sheet1, the following Run time error 1004 appears: Unable to get the Pivot Tables property of the Worksheet class….when I select Debug, here’s the code with the bolded section being the point of error:
ActiveSheet.Unprotect Password:="test"
Range("K9").Select
ActiveCell.FormulaR1C1 = "=NOW()"
Range("K9").Select
Selection.Copy
Range("K9").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("h161").Select
ActiveSheet.PivotTables("PivotTable1").PivotCache.Refresh
ActiveWorkbook.ShowPivotTableFieldList = False
Columns("I:I").Select
Selection.ColumnWidth = 14.86
Range("A19").Select
ActiveSheet.Protect Password:="test"
End Sub
I guess I understand why I’m getting the Run time error (because the PT no longer exists); question is, why is it being discarded in the first place…?!?
Any assistance in correcting this will be greatly appreciated.
Thank you…Anthony