Preserve Formatting crashing excel

  • Thread starter Thread starter Grant
  • Start date Start date
G

Grant

Hi there,

when I use the following code:

For Each pvtTable In ActiveWorkbook.Worksheets
(wkSheet.Name).PivotTables
With pvtTable
.PreserveFormatting = True
.RefreshTable
End With
Next pvtTable

The preserveformatting is crashing excel. I know this
because when I take it out it works.

Any ideas?
Grant.
 
This sounds crazy but i think the Preserve Formatting function is cas
sensative...

I tried it and this worked, hope it helps...

For Each pvtTable I
ActiveWorkbook.Worksheets("sheet4").PivotTables
With pvtTable
.preserveformatting = False
.RefreshTable
End With
Next pvtTable
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top