View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
grant grant is offline
external usenet poster
 
Posts: 24
Default 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.