VB and Powerpoint

T

Tina

I am creating VB code to automatically create a PowerPoint deck and the one
thing that I can not do is change the series in rows to series in columns in
the VB code.
For example when I create my slides the data is automatically series in rows
but I want it to series in columns.
This seems a simple enough task.
Thanks to anyone for help.
 
S

Shyam Pillai

Tina,
I think you are referring to graphs within PowerPoint. You have to use the
'PlotBy' method to achieve this.

' =========================================================
Sub Plot(oShp As PowerPoint.Shape, SeriesType As Integer)
Dim objGraph As Object 'Graph.Chart

Set objGraph = oShp.OLEFormat.Object
With objGraph.Application
.PlotBy = SeriesType
.Update
.Quit
End With
Set objGraph = Nothing
End Sub

Sub Test()
' Assumes that selected shape is a graph object.
Call Plot(ActiveWindow.Selection.ShapeRange(1), 2) ' xlColumns = 2
End Sub
' =========================================================
 

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