Accessing chart in VBA

R

Rod

I couldn't find a PowerPoint VBA group. If this is the wrong place to post
VBA questions please redirect me.

I have VBA code in an Access database and I want to write data to the table
behind a chart in a PowerPoint presentation.
I can do this in Excel and Word, but PP seems to be something different
again.

I have got as far as this

Public Sub Main()

Dim objPP As PowerPoint.Application
Dim objPres As PowerPoint.Presentation

Set objPP = New PowerPoint.Application

Set objPres = objPP.Presentations.Open(......................

Any help very much appreciated.
 
R

Rod

Steve Rindsberg said:
Where in the presentation is your chart? You'll need to get a reference
to it next.

For example:

Dim objChart As Graph.Chart
Dim objDataSheet As Graph.DataSheet
Set objChart = ActivePresentation.Slides(1).Shapes("Object
4").OLEFormat.Object
' the rest should be pretty much the same
' as you're already doing
With objChart
Set objDataSheet = objChart.Application.DataSheet
With objDataSheet
Debug.Print .Cells(2, 4) ' or whatever
End With
End With

Almost exactly what I had.
Turns out that the graphs were actually Excel. I don't know if the original
user embedded Excel charts or it is a feature of their Office 2007 (I'm on
office XP).
Anyhow it kept me confused for a while

thanks for your advice

Rod
 

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