Select PowerPoint Slide using Names in Excel environment - excel

I've set up a macro that copy/pastes graphs and tables from a spreadsheet to specific slides in a pre-existing PowerPoint presentation using excel VBA. In the code, I have to specify the exact slide number to copy the excel graph to (done 100+ times).
The issue is that when slides are added/deleted from the presentation in the future, the slide numbers will change and I will have to go through the code and manually update each slide reference.
I'm looking for a way to name slides in PowerPoint then use those names in my excel vba code? Eliminating the risk of slides being added/deleted later on (which will definitely happen).
This post is similar in concept( vba powerpoint select a slide by name), but I can't seem to get it working using the excel vba.
An excerpt of the code I'm using to paste a graph is below. Instead of referencing slide 54, I'd rather use a named slide like "Performance":
Set oPPT = GetObject(, "PowerPoint.Application")
Set presUpdate = oPPT.Presentations("Presentation Name")
With presUpdate.Slides(54)
.Shapes.PasteSpecial(DataType:=xlBitmap).Select
.Shapes("Picture 1").Left = 34.01559
.Shapes("Picture 1").Top = 96.36512
End With
Thanks

Suppose you have 3 topics, Performance, Issues and Sales
In the master layout of the PowerPoint document create 4 slide layouts and rename them to
Performance
Issues
Sales
Others
Once that is done, sort and paste all the content according to the topics (yes this is a painful process, but its one time), by right clicking on the slide and choosing one of the 4 layouts.
If the document contains 100 slides, the below is the scenario
Performance: 20 slides
Issues: 30 slides
Sales: 10 slides
Others: 40 slides
Even if they are reordered you can write a macro that can search for the slide name and relevant changes can be done.
The main point here is that the SLIDE NAME is your INDEX and having them sorted like this will help you in the long run.
Hope this answers your question

Related

Extracting certain Powerpoint slides based on an Excel table and combine to new presentation

I have a huge PPT presenation (>400 slides) and want to extract certain pages based on an Excel table and create a new, smaller presentation.
I created an Excel table which includes the page numbers as well as the title of each slide in the PPT presentation.
The goal now is, to have a macro that allows me to create a new PPT with all the slides that are mentioned in my (sorted) Excel table.
As I am new with VBA (I am only able to copy/paste code and run it afterwards), I was not able to try anything.
Thanks for your help!

Powerpoint: Linking Excel charts & updating them or deleting old charts & inserting updated ones?

I have a PowerPoint presentation containing Excel charts and .png files. This presentation needs to be updated fairly often and I’d like to use VBA for this. However, I’ve read up on linking charts from Excel to Powerpoint and it seems not to be bug-free, but I don't really know anything about it.
So I need advice what makes the most sense because I don't have any experience with this. Is updating the charts usually not an issue? Or would it be more fool-proof to delete the old charts and insert the new ones? In case it's the latter, would I simply define the dimensions of the chart or does the use of placeholders offer any advantages?
What I've done in the past is use VBA to paste pictures of the charts into the slides. Then the presentation serves as a snapshot, and I don't need to worry about links.
You can set up a table with details like chart name, worksheet name, slide number, image size (width, height) and position (left, top). Then the code moves down the list, finding the worksheet, copying the chart, activating the slide, pasting the chart as a picture, moving it into position. Best results are when the chart is sized right in Excel so you don't need to resize it in PowerPoint.
It's been a while, so I don't have that code at my fingertips. I'll hunt around when I have a chance.

Pre-populating PowerPoint file with Excel input

I am currently in the following situation:
I have an Excel file where I perform calculations and charts + diagrams are created based on the calculations.
I have a PowerPoint report where I have to copy-paste these visualizations into.
I will need to repeat this process for many Excel files, all containing the same lay out. You can view them as a questionnaire: each Excel file is completed with different answers, though the structure remains the same.
Is there a way for me to create a template PowerPoint report file, where at the start I select which Excel file to 'load', and it pre-populates my PowerPoint file with the correct charts from the selected Excel file?
ndeed, there is a free option available. With SlideFab 2 (lite) you can automate Excel to Powerpoint without coding: You would need to setup the Powerpoint template and link all shapes with the required Excel ranges or charts. Then SlideFab creates the slides for you. When the structure is really the same, you could just let SlideFab connect to the next Excel file and rerun the slide-making process again.
You could also consider using RDBmerge to collect all workbook sheets into one Excel and using formulas to create a kind of staging area which is used for linking with Powerpoint. This would have the benefit that when you iterate a list of worksheet names, your lookup (e.g. using vlookup or index/match) functions would grab the appropriate data into the staging area. SlideFab could then create all slides at once through changing the selected worksheet in a repetitive way.
In case of questions, feel free to reach out.
Disclaimer: I am the owner of SlideFab 2.
Cheers
Jens

VBA code to cut and a paste a slide

I am writing a VBA code in Excel 2010 to search for a particular text (
that I am inputting from Excel) in a Presentation, cut that slide and paste the slide next to slide where the same text (again inputting from Excel) is found in the Presentation.
And I want to repeat the same for around 50 times, i.e, I want to find 50 texts in PPT and cut those slides and paste them somewhere else.
Can I do this using Excel VBA code??
Yes.
You'll need to add PowerPoint's Object Library and look up the existing solutions with Google.

Cannot update embeded excel links in powerpoint to a different sheet

I have monthly report data in separate tabs, Jan to Dec.
I took the data from Jan and linked it to a powerpoint page in order to display it for briefings. I have the layout set exactly how I want it, so I copied the slide and then wanted to edit the new slide to use the data from Feb instead of Jan, however I can't seem to update the links so they use the other sheet. It just asks me to select a new file.
The links option allows me to select a new spreadsheet file but not the same file and different sheet. Is there anyway around this?
The data embedded in the ppt is both cell data & charts.
Hopefully, I've explained what I mean well enough.
Many thanks for any help and advice. =)
Your subject mentions links but later you say "The data embedded in the ppt ..."
Linked and embedded objects are two different things with different behaviors.
If you want different slides to point to different parts of your worksheet/workbook and to update at need, you'll want to do this for each slide:
Select the data in Excel
Copy it
Switch to PowerPoint, move to the slide where you want to display the data
Choose Paste Special, then choose to Link
You could, in theory, accomplish something similar by creating one link, then copying the slide and finally editing the link target, but that'd take either an add-in or some coding, and would in any case probably be more trouble than it'd be worth.
Create a tab in the file and name it "Current" or something to that effect.
Link it to the month tab you want, like Jan.
Create the link in powerpoint how ever you have already, to this tab and not the Jan tab.
you can change the links in the tab "Current" to point to a different tab, like Mar.
Update you powerpoint by either up dating links (for pastespecial as link ) or just double click the embedded object in powerpoint while the Excel file is already open

Resources