![]() |
PPT in excel macro
Hi
i have 9 ppt files in a folder, i need a macro to open each ppt files and copy the slides of each ppt files into one new ppt file.(merging all the ppt files slides into one ppt file) |
PPT in excel macro
Try something like this
Sub test() Set PPObj = CreateObject("PowerPoint.Application") PPObj.Visible = True a = 1 Set NewPresentation = PPObj.presentations.Add For Each obj In ActiveSheet.OLEObjects If Left(obj.progID, 10) = "PowerPoint" Then a = 1 obj.Activate Set PPApp = obj.Object.Application For Each sld In obj.Object.slides sld.Copy NewPresentation.slides.Paste Next sld End If Next obj End Sub "Ranjit kurian" wrote: Hi i have 9 ppt files in a folder, i need a macro to open each ppt files and copy the slides of each ppt files into one new ppt file.(merging all the ppt files slides into one ppt file) |
PPT in excel macro
Hi Joel
Thanks for the reply, but you hv't understood my query, please find the below example I have saved five ppt files in a folder(path:c:/documents/ppt/) 1)Buss.ppt 2)Age.ppt 3)Amt.ppt 4)Camp.ppt 5)Trip.ppt All the above five .ppt files contains only one slides. I need a macro to go to the above folder and open each .ppt files and copy the slides to a new ppt file (merge the five .ppt files to a single ppt file) "Joel" wrote: Try something like this Sub test() Set PPObj = CreateObject("PowerPoint.Application") PPObj.Visible = True a = 1 Set NewPresentation = PPObj.presentations.Add For Each obj In ActiveSheet.OLEObjects If Left(obj.progID, 10) = "PowerPoint" Then a = 1 obj.Activate Set PPApp = obj.Object.Application For Each sld In obj.Object.slides sld.Copy NewPresentation.slides.Paste Next sld End If Next obj End Sub "Ranjit kurian" wrote: Hi i have 9 ppt files in a folder, i need a macro to open each ppt files and copy the slides of each ppt files into one new ppt file.(merging all the ppt files slides into one ppt file) |
All times are GMT +1. The time now is 01:38 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com