Macro to put Graphs into PowerPoint

D

David Evans

Okay, at the moment, I have two excel graph macros that when ran, the
open up a .csv file, and create the graph based on that data, on a ne
worksheet.

The problem is, I need the ability to generate these graphs i
PowerPoint, but I'm unsure as to how best to do this.

Ideally, I need to have a presentation, with numerous graphs, so when
button next to the graph is pressed, the graph is removed, and the
re-generated from an external .csv file.

Any suggestions as to the best way I should do this?

Thanks
 
J

Jon Peltier

Being a big Excel user, I'd keep using Excel as the brains behind the
operation. It's easy to send a chart from Excel to PowerPoint. If you
can open a CSV file and update a chart, you can follow the instructions
on my web site:

http://peltiertech.com/Excel/XL_PPT.html

The piece that's missing is the button in PowerPoint. You could do
something simple like add a hyperlink to a PowerPoint graphic object,
then start the Excel chart procedure in the Workbook_Open event
procedure in the workbook that does the charting. The workbook updates
the chart, sends the new chart to PowerPoint in place of the existing
one, and then closes itself. Or you could actually run a procedure in
PowerPoint that opens the Excel file, runs the code, pulls in the chart,
and closes Excel.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______
 
D

David Evans

These don't seem to work, I'm using Excel / Powerpoint XP

The first thing it doesn't seem to like, is:
Set PPApp = GetObject(, "Powerpoint.Application.8"
 
J

Jon Peltier

Hi David -

I need to update the page. Strictly speaking, you need to put a suffix
referring to your version of Office, which for XP means:

Set PPApp = GetObject(, "Powerpoint.Application.10")

But it seems that you can skip the suffix altogether, and Office will
figure it out for you.

Set PPApp = GetObject(, "Powerpoint.Application")

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______
 

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