Good point - Forgot you weren't mindreaders for a sec there!
Anyway, here's the code:
''' Some Dims
Dim oGraph As Graph.Chart
etc
''' Grab the active xl chart and active ppt chart
Set oPPTApp = GetObject(, "Powerpoint.Application")
Set oGraph = oPPTApp.ActiveWindow.Selection.ShapeRange(1).OLEFormat.Object
Set appXL = GetObject(, "Excel.Application")
Set XLchart = appXL.ActiveChart
''' Update the data
For x = 1 To appXL.ActiveChart.SeriesCollection.Count
For y = 1 To appXL.ActiveChart.SeriesCollection(x).Points.Count
DataArray = appXL.ActiveChart.SeriesCollection(x).Values
oXValues = appXL.ActiveChart.SeriesCollection(x).XValues
oSeriesName = appXL.ActiveChart.SeriesCollection(x).Name
oXValue = oXValues(y)
oGraph.Application.DataSheet.Cells(1 + x, 1 + y) =
DataArray(y)
oGraph.Application.DataSheet.Cells(1, 1 + y) = oXValue
oGraph.Application.DataSheet.Cells(1 + x, 1) = oSeriesName
Next y
Next x
''' Update the formatting
With oGraph
.ChartType = XLchart.ChartType
With .ChartArea
.AutoScaleFont = XLchart.ChartArea.AutoScaleFont
With .Border
.Color = XLchart.ChartArea.Border.Color
.Weight = XLchart.ChartArea.Border.Weight
.LineStyle = XLchart.ChartArea.Border.LineStyle
End With
With .Fill
.Visible = XLchart.ChartArea.Fill.Visible
If XLchart.ChartArea.Fill.Type = msoFillSolid Then
.Solid
With .BackColor
.SchemeColor =
XLchart.ChartArea.Fill.BackColor.SchemeColor
End With
With .ForeColor
.SchemeColor =
XLchart.ChartArea.Fill.ForeColor.SchemeColor
End With
End If
''' There's actually quite a lot of formatting - i won't bore you with
the details
End With
End With
I expected the formatting section at the end to take some time to run,
but even the data updating section seems to be very slow
Any ideas on why this is greatly appreciated,
Steve