Reorder Powerpoint slides from Excel with VBA

tiredofit

Well-known Member
Joined
Apr 11, 2013
Messages
1,924
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

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
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

Forum statistics

Threads
1,223,884
Messages
6,175,177
Members
452,615
Latest member
bogeys2birdies

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