Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello:
I'm having trouble creating a pivot chart using vbscript. I have a vbscript that pulls info from AD and dumps it into Excel. I currently add the pivot chart manually to each report, but wanted to automate it. Is this possible? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On 4 Mar, 19:41, T2A4D wrote:
Hello: I'm having trouble creating a pivot chart using vbscript. I have a vbscript that pulls info from AD and dumps it into Excel. I currently add the pivot chart manually to each report, but wanted to automate it. Is this possible? Oooh, my first occasion to return the help I received on the ng :) First of all, what's AD? Pivot charts are very easy, but Pivot Tables (from which Pivot Charts are created) are not so simple, so you might want to play with the Macro recorder for some time before writing your own macro. Anyway, I assume that you already know about PivotCaches, PivotTables and all that jazz. Let's go straight to Pivot Charts: Sub AddPivotChart(PT As PivotTable, ChartName As String, cht As Chart) ' Add a PivotChart associated with PivotTable PT ' First of all, create a chart sheet for your Pivot Chart: I have my own "safe" Add Chart routine, ' you can use yours or just use the Charts.Add method, even though that's no so safe Call AddChart(ChartName, cht) With cht 'Pivot Chart Name .Name = ChartName 'A Chart becomes a Pivot Chart, basically, when you set the SourceData to a PivotTable .SetSourceData Source:=PT.TableRange1 'Add title .HasTitle = True .ChartTitle.text = ChartName 'Change format to what suits your chart best .ChartType = xlLineMarkers End With End Sub Hope this helps, Sergio Rossi (deltaquattro) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Set a reference to Microsoft VBScript Regular Expressions(vbscript.dll) | Excel Programming | |||
How to create chart from Pivot table but not Pivot chart? | Charts and Charting in Excel | |||
create line chart with two axises in Pivot Chart | Charts and Charting in Excel | |||
How can you create a Pivot Table using vbscript | Excel Programming | |||
Using VBScript to create Excel SS and sort by column. | Excel Programming |