Copy-paste from Excel to PowerPoint via VBA: Align two pictures - excel

I'm using VBA to copy-paste ranges from Excel into PowerPoint. I have three Excel sheets from which I copy two different things: the data and the annotations. On the PowerPoint slides, data and annotations are supposed to be next to each other, data on the left, annotations on the right. However, these sections are of different sizes. I have no problem putting the data on the slides with the help of a for each loop, but how do I get the annotations to fit snugly to the right of the data?
Right now I have three sections of very similar code for the three different sheets because I don't know how to align data and annotations without manually defining myShape.Top and myShape.Leftfor annoations. Is there a way to tell PowerPoint "Put this picture next to the other picture?"

Related

Copy all charts from excel into an existing powerpoint

I have 35 excel files that each have 50 charts in them (all on the same sheet). I need to copy each of the charts over to a powerpoint file, which is already made with specific formatting and labels for positioning of the charts. How would I go about writing a script that will reference all of the charts in the respective excel file and then send them to the powerpoint at specific locations and page numbers of the powerpoint, some being differently sized?
I am assuming a forloop for referencing each of the charts, then an explicit code for each chart once numbered in the forloop to resize and place at specifc locations in the powerpoint.
Once I get an idea of how to reference each of the charts, resize and then place at specific point in the ppt slide, I can automate the entire thing.
Please note that StackOverflow is not a coding service. Bearing that in mind this is how I would go about it:
1. Put placeholders in the PowerPoint. These placeholders contain a unique identifier of each chart object (e.g. Workbook1.Sheet1.Chart1). I would make sure they are sized as your chart would be in the end (width & height) and that they are invisible. I would use rectangles with 100% transparency, and use the Alt Text property.
2. Write a sub that deletes all charts but keeps all placeholders in your PowerPoint file.
3. Write a function that retrieves the charts per placeholder.
4. Write a sub that copies the chart object and pastes it as a picture.
5. Write a sub that loops through all placeholders in your file, gets and pastes all charts.

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

Inconsistent colors in Excel/PowerPoint/Word Charts

I have two scatter plots, representing the same things, but for two different scenarios. They were created in the same Excel workbook, on different sheets, and I have the same color schemes applied to them. However, the colors don't line up between the charts. I have 6 charts total, and 4 start with the dark color and the other 2 start with a lighter color.
Chart 1 - first color is very dark
Chart 2 - first color is lighter
I haven't been able to find anyone else who's run into the same problem. This issue occurs when I copy the charts into PowerPoint and Word as well. This is pretty annoying because I want to keep the colors consistent throughout my charts.
EDIT I can copy the chart with the colors I want and then just edit the data, so the charts are all consistent. Still not sure how they ended up different colors, though.
I've run into this issue in the past. I've looked around and found the following suggestions.
After copying the chart from Excel, when you're in either Powerpoint or Word, click on the downward arrow for "paste", then try to do any one of the following:
'paste special' then 'paste link'; or
'paste options' then 'keep source formatting'; or
'paste options' then paste as 'picture'.
The last one should definitely work, since you're pasting a static photo. That is, it will be uniform regardless of the program because it's based on the calibration setting of your monitor.

How do you share info between two or more worksheets embedded in a PowerPoint presentation

In Excel, it is easy to link cells on sheets within a workbook or even between separate files.
Is it possible to do the same thing between two or more Excel worksheets which are embedded on to PPT slides?
I've defined a named range in one spreadsheet but there is no obvious way to reference/find that range within the spreadsheet on another slide. Am I missing something obvious here?
I'm hoping that I do not need to use VBA (though I will if that is the only option).
If you looking for a vba solution, this may help you get started:
Update information within unrelated excel objects inserted in slides of a presentation
http://skp.mvps.org/ppt00040.htm#4

Resources