Format PivotTable from VBA out of MS Access

H

hannes

Hi,
I have created different functions which move certain data from MS Access to
Excel in an PivotTable and PivotChart. The PivotChart formatting works,
however I try now to format the PivotTable itself but it always fails - or at
lesast I don't know what to do exactly. I use version 2002.
Here some samples:

With xlAPP.ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "Title"
End With

Setup of Pivot Table:
With xlAPP.ActiveSheet.PivotTables("PivotIndex")
.PivotFields("Category").Orientation = xlRowField
.PivotFields("Series").Orientation = xlColumnField
.ColumnGrand = False
.RowGrand = False
End With

With xlAPP.ActiveSheet.PivotTables("PivotIndex").PivotFields("ChartValue")
.Orientation = xlDataField
.Function = xlSum
.Position = 1
End With

However the same for the PivotTable seems not to work: (as mentioned I like
to format the font, size, etc...)

xlAPP.ActiveSheet.PivotTables("PivotIndex").PivotFields("Series").Font.Name
= "HelveticaNeueLT Std Cn"
 

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

Top