Change PowerPoint slide size in Excel 2013 VBA - vba

I use VBA scripts in excel to generate PowerPoint slides for reporting. However since we've upgraded to to Office 2013 my slides are generating in the new default of Widescreen (16:9) rather then Standard (4:3).
What is the Command in VBA to change the size of the PPT slides you are creating? I assume it is a property of PowerPoint.Application but I couldn't figure it out.
Thanks, for the Help!!
-Colin

ActivePresentation.PageSetup.SlideSize = ppSlideSizeOnScreen
thanks

Related

Change default slide-size on PowerPoint 2010

I use PowerPoint 2010 and need to create automatically PowerPoint (with excel VBA) with the slide size 16:9, so I would like to set this value as the default one (instead of 4:3). Could someone help me ? Or does someone maybe know how to choose this Slide-Size with excel VBA ?
Thanks for your help !
Charlotte

Create PPT Chart based on Excel information

I have a table in PPT that I copied over from excel and I want to create a PPT chart based on that information through VBA. What I want to know is, is there a way to create a chart based off of that table and not off of the little excel spreadsheet that PPT automatically opens? Any help would be greatly appreciated.
If the chart is inserted in the slide from PowerPoint itself, the chart uses the PowerPoint DataSheet as its data source. You can open this PowerPoint DataSheet in Excel and link it to the Excel data you want to plot.
Alternatively you can make the chart in Excel based on the Excel data, then copy the chart and paste it (using onw of the link options) into PowerPoint. It will behave as a native PowerPoint chart (which is really a native Excel chart) but it will be based on the Excel data.

Update charts in PowerPoint in VBA

I have a couple charts in a powerpoint presentation that I want to write a macro for to update them automatically. I have a database that will export data as excel spreadsheets and I was wondering if there was a way in either excel vba or powerpoint vba to have the user input the location of the new data file and have that new data copied and pasted so that the chart will update. I am new to VBA so any help would be greatly appreciated.
You can easily do this by editing link to the ppt charts to the new file.
Simply go to the
Excel Option Button>>Prepare>>Edit Links to Files and change source of the charts to the new file.
Let me know if you still want/need to use VBA for this.
Cheers

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.

How Can I Access Notes in a PowerPoint 2003 Slide

I have been using VB to manipulate notes in PowerPoint presentations.
Until today, everything had been working fine (in PowerPoint 2007) using:
strReturn = myPres.Slides(commandeObject.slide).NotesPage.Shapes(2).TextFrame.TextRange.Text
But today I tried the code on a PowerPoint 2003 presentation and it threw an error saying that the object didn't exist.
I tried looking in shape 1 and 0, but I don't find the notes.
I then tried updating the presentation to the 2007 format, but the notes are still not accessible using VB, although they appear in the PowerPoint window fine.
Any suggestions on how I could find the notes in older presentations would be really helpful - I have lots of old presentations and it would take ages to rewrite them all...
Cheers,
Dave
I tried simliar code opening an old PowerPoint 2003 document that I confirmed had notes in it, and your code worked fine. What is the "commandeObject.slide" reference? I'm wondering if that is the problem?
Perhaps you could try something slightly different like this to loop through all the slides in the deck? This worked for me.
For Each s as Microsoft.Office.Interop.PowerPoint.Slide In myPres.Slides
Console.WriteLine(s.NotesPage.Shapes(2).TextFrame.TextRange.Text)
Next