Slide format getting changed when we paste a slide to new presentation - vsto

We are working on PowerPoint add-in application. In this application, we have a feature for programmatically create the presentation using slides. In between, we noticed an issue related to slide formatting.
The issue is, when we copy a slide in a presentation to new presentation, it seems that the slide format is getting changed. This issue is not related our add-in application. You can see the issue in PowerPoint itself.
Original slide in the presentation
When we copy slide to the new presentation, the format seems to get changed
You can see that graph section getting changed.
When we paste the slides, we will get following options. “Use destination Theme”, “Keep Source formatting” and “Picture”. Even if we selected the “Keep Source Formatting” option, our issue not gets resolved. When we paste the slide using “Picture” option it worked well, But we can’t edit such slides.
How do we paste the slide with the correct format and editable option? Is there any way to solve this issue? Any help would be appreciable.
Presentation link
https://docs.google.com/presentation/d/1uBmQukvmY5XflMXK1-3m0YXzCp4AXSh3Jknj1E_EpQU/edit?usp=sharing

Related

PowerPoint 2013 "PasteSpecial" won't embed Excel chart as OLE Object

I've written a macro in PowerPoint that, as part of its process, will convert a linked chart in a PowerPoint presentation to an embedded chart by copying the source Excel chart and pasting that copied chart in as an OLE object -- the specific command is, "sldComponent.Shapes.PasteSpecial(ppPasteOLEObject)".
Until today, this has worked fine in all versions from 2003 to 2010. However, when trying to run this function in 2013/365, I keep getting a run-time error stating "The specified data type is not available" (-2147188160 / 80048240). I also notice that in the Microsoft Developers Reference webpage, "ppPasteOLEObject" is no longer listed as an acceptable datatype for the PasteSpecial method (when used with the Shapes collection).
I have found several ways to programmatically paste the chart as a picture, but whenever I click on the pasted chart and try to access the data, I keep getting the message "The linked file is not available." I want the data to be entirely self-contained so the PowerPoint user can edit it without reference to the original Excel file. Interestingly, when I stop the PowerPoint macro at the buggy line and then manually click "Paste" on the ribbon, the copied chart does paste, fully embedded with data accessible, into the active slide -- so the chart is getting copied into the Clipboard; the PowerPoint macro is simply unable to read and paste it for some reason. Even more interestingly (read: frustratingly), the PasteSpecial(ppPasteOLEObject) command will work for tables copied from Excel, i.e. cell ranges, but not for charts.
What happened? How does one use VBA code in PowerPoint 2013 to embed (i.e. insert a previously-created, self-contained Excel chart including all data right in the presentation slide) an Excel chart in the new version?
ADD: I should also note that the command used to get the chart from the source worksheet in Excel is "xlCopySheet.ChartObjects(1).Select", then "appExcel.Selection.Copy". Is the problem that the chosen Copy syntax is not capturing the entire chart including data but only the display? What is the correct Copy syntax to use here?
ADD 2: Further specification: The original macro was saved and was running with both Excel and PowerPoint in Compatibility (97-2003) mode, although the apps themselves are the 2013/Office 365 versions.
If you paste the chart as a "Microsoft Office Graphic Object", the chart is pasted as an Excel chart. You can format it within PowerPoint using the Excel ribbon's Chart Tools tab, which appear in PowerPoint. If you click any of the edit/select data buttons, it opens the data in Excel.
If you paste the chart as a Microsoft Excel Chart Object, it is pasted as an embedded workbook (the entire workbook, not just the chart and its data), with a new chart sheet inserted in the embedded workbook, and this chart sheet is what is visible. You need to double click to format or edit the chart, which opens the embedded workbook in Excel, and may mess up the size of the embedded object (so it's chart-sheet sized, not chart-embedded-in-the-worksheet sized) and things like font size.
If I copy the chart in Excel and use this in the PowerPoint VB Immediate Window
activepresentation.Slides(3).Shapes.PasteSpecial ppPasteOLEObject
I get the second behavior.
You might want to try copying the chart using this:
xlCopySheet.ChartObjects(1).Chart.Copy

Link Dynamic SQL Chart In Powerpoint

I'm working on a project that needs to be displayed via Powerpoint. I have a SQL chart that is refreshed every morning at 9 am and 12 pm with updated results. I need this information to display within a Powerpoint slideshow for our team, but I'm not sure how to do this where I can see the updated results. I tried inserting the excel spreadsheet as an object and linking that way, but that has not worked.
If the chart is in Excel and automatically refreshes, try it like so:
First, make sure that the PPT file and the XL file are in the same folder if possible.
Select the chart in Excel and rightclick/copy.
Switch to PowerPoint.
Use Paste Special and put a check next to Link to paste the chart into PPT.
I would paste it onto a slide that does NOT have a content placeholder; delete it or put some text into it if one's already there, then paste the chart.
PowerPoint should now update the chart each time you open the presentation, assuming the data/chart have changed in XL.

VBA code to change size of one slide only in powerpoint

how can I change the size of one slide in a presentation using VBA?
I know the PageSetup.SlideWidth and PageSetup.SlideHeight properties, but these work on the presentation and as a result on all slides.
I'm sure this is possible, since you can do this manually in powerpoint.
Thanks a lot!
You can't. Not under program control, not manually.

Programmatically set a picture as a powerpoint background through file embedded on an excel template

I'm generating a PPT presentation through vba in excel, everything is working just fine except that Im being asked to automatically set background of the power point (which it wouldn't be much a problem) but this will be done with a picture that is actually embedded on the macro, so I dont have physical path to reference the picture, plus the excel is generated on the fly according to the user inputs.
so.. has anyone achieved this : Programmatically set a slide backrground from vba excel with a picture that is embedded on a sheet?
Thanks!
As far as i understand, you want to set the background of the slides in vba (it doesn't matter it is called from Excel).
Let's assume you have the path in a var:
Dim osld As Slide
Set osld = ActivePresentation.Slides.Range 'every slides of the presentation
'This is important in some cases
osld.FollowMasterBackground = False
With osld.Background.Fill
.UserPicture <string var containing path to image>
End With
End Sub
You will also have to adapt ActivePresentation with the PPT object you built from your previous code.
If you can't find a way to set the background directly from a picture in memory, what about copy/pasting the picture from Excel into the Slide Master(s) in your PPT presentation then sending them to the back so they sit behind everything. The effect would be nearly identical from the user's point of view, I think.

How to copy picture from Word to Powerpoint programmatically?

I am creating a macro that converts a Word 2007 document into a structured PowerPoint 2007 presentation. I am looping over all the paragraphs of the document and copying them over to the new presentation.
I am able to copy and paste the paragraphs to the presentation just fine. But I also need to be able to copy and paste the pictures from the Word document into the PowerPoint (and in the right location between paragraphs).
So far, I am able to detect if a paragraph is a picture by looking at the paragraph's style attribute - it will say "Figure". But, I don't know what to do from there. After looking online, it looks like I should be able to do this:
paragraphFromDocument.Range.Copy
currentSlide.Shapes.Paste
But, this doesn't seem to work. How do I copy a picture from Word to PowerPoint?
Thanks
EDIT
I've also tried:
paragraphFromDocument.Range.CopyAsPicture
currentSlide.Shapes.PasteSpecial(ppPasteMetafilePicture)
and get this error message:
Shapes.PasteSpecial : Invalid Request. Clipboard is empty or contains data which may not be posted here.
But, when I use that CopyAsPicture command, I am able to open up PowerPoint (with the picture still on the clipboard from the macro) and use the Paste Special command to paste the picture to the slide.
paragraphFromDocument.Range.Copy
currentSlide.Shapes.Paste
actually did end up working, but I had to remove all special characters from the range first. That is why it was giving me the error message.