PDA

View Full Version : [SOLVED] amend excel VBA for powerpoint



siwelniffoc9
10-01-2015, 03:43 AM
I have the below code for excel which combines all open workbooks sheets into one workbook and closes the old copied workbook. i am wanting to adapt this so that it does the same in powerpoint, takes all open presentations and copies slides into active presentation. help please

Sub Macro1()
Dim wb As Workbook
Dim wbThis As Workbook
Set wbThis = ThisWorkbook
For Each wb In Application.Workbooks
If wb.Name = wbThis.Name Then GoTo 10
wb.ActiveSheet.Copy After:=wbThis.Sheets(Sheets.Count)
wb.Save
wb.Close
10
Next wb
End Sub

Paul_Hossler
10-01-2015, 06:05 AM
I think you'll have more PPT responses if you posted in the PopwerPoint forum

The PP object model is VERY different from Excel's, AND PP does not have a macro recorder which really makes it hard

John Wilson is very good with PP and is in the forum a lot

snb
10-01-2015, 08:20 AM
Sub M_snb()
For Each pp In Application.Presentations
If pp.Name <> ActivePresentation.Name Then
For Each it In pp.Slides
it.Copy
ActivePresentation.Slides.Paste
Next
End If
Next
End Sub