Reorder Powerpoint slides from Excel with VBA

tiredofit

Well-known Member
Joined
Apr 11, 2013
Messages
1,834
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
In Excel, it is possible to refer to a worksheet by its name, codename or index.

For Powerpoint, I know it's possible to refer to a slide by its index but does each slide also have a name property and if so, can it be changed?

My ultimate objective is to use VBA in EXCEL to reorder the slides in POWERPOINT.

Say I have 5 slides, A, B, C, D, E.

I want to swap A and B round, so the new order needs to be B, A C, D, E.

Is it possible and if so, how might I go about it?

Thanks
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Take a look at this link it may help. Do you know the code to control PowerPoint. I.e. open PowerPoint as an application and then open a presentation?

 
Upvote 0
Take a look at this link it may help. Do you know the code to control PowerPoint. I.e. open PowerPoint as an application and then open a presentation?

I assume you're refering to this?

Code:
Sub MoveSlideToNewLocation()    ActivePresentation.Slides(2).MoveTo toPos:=1End Sub

That identifies by Index, not SlideID.


"Do you know the code to control PowerPoint. I.e. open PowerPoint as an application and then open a presentation?"

Yes I can open pptx from Excel.
 
Upvote 0
Yes that's what's suggested.

You could give each slide a title and use the title or refer to the slideid. See if this link helps.

 
Upvote 0

Forum statistics

Threads
1,215,231
Messages
6,123,754
Members
449,119
Latest member
moudenourd

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