Preserve formatting setting in VBA crashing Excel
When I use the following peices of code together they
crash Excel saying "Method CurrentPage of object
PivotField failed", and then when I close Excel it
crashes.
ActiveWorkbook.Worksheets(wkSheet.Name).PivotTable s
(pvtTable.Name) _
.PreserveFormatting = True
ActiveWorkbook.Worksheets(wkSheet.Name).PivotTable s
(pvtTable.Name) _
.PivotFields("Line").CurrentPage =
sStr
But when I just use either one on its own its fine.
Any ideas?
Thanks,
Grant.
|