VBA: putting a series of graphs from Excel into PowerPoint

EdwardAveyard

New Member
Joined
Feb 9, 2015
Messages
10
I created a spreadsheet with a drop-down that changed the data on display in the graph for the selection. I've been asked to create a powerpoint pack that shows each of these graphs on a different slide.

There are 35 options in the drop-down. There are actually two graphs for each option. The end product should have 35 slides (excluding the title slide) each with two graphs on.

I can work out the bits solely in Excel but not the bits in PowerPoint.

Excel bits
Going through the 35 options
For i = 1 To 35


'Cell A1 on Sheet1 has the value fixed to the drop-down. Changing this changes the graphs. The drop-down is also set to run the macro TissueSelection each time.
Sheet1.Cells(1, 1).Value = i
Call TissueSelection

'(after all the rest of the code that I don't know yet)
Next i

Copying the graphs (this would go somewhere in between Call TissueSelection and Next i, but I'm not sure where as I can't work out the other PowerPoint bits
ActiveSheet.ChartObjects("Chart 3").Activate
ActiveChart.ChartArea.Copy

ActiveSheet.ChartObjects("Chart 4").Activate
ActiveChart.ChartArea.Copy



Where I'm stuck: how to interact with PowerPoint
I have tried a few things online but none of them works. I need to open an existing PowerPoint file, add in a new slide each time and then paste the two graphs on that new slide, before then doing the next i.

This one fails on Set PPApp = GetObject("Powerpoint.Application"). I get run-time error 424 "Object required".
This one fails on Slidecount = PPPres.Slides.Count with error 424 again.

I'm wondering if I need to have another reference library ticked. This is what I have on currently:
  • Visual Basic for Applications
  • Microsoft Excel 16.0 Object Library
  • OLE Automation
  • Microsoft Office 16.0 Object Library
  • Microsoft SQL Server PowerPivot for Microsoft Excel

Thanks will go to anyone who can help me with this.
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
if you haven't discovered it,. break every link. i did loads, then updated and had one graph the same on every slide
 
Upvote 0

Forum statistics

Threads
1,223,891
Messages
6,175,229
Members
452,621
Latest member
Laura_PinksBTHFT

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top