Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 83
Default 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)


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default 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)


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 83
Default 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)


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 1 February 5th 07 09:31 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 3 February 5th 07 08:22 PM
Need syntax for RUNning a Word macro with an argument, called from an Excel macro Steve[_84_] Excel Programming 3 July 6th 06 07:42 PM
translate lotus 1-2-3 macro into excel macro using excel 2000 krutledge0209 Excel Programming 1 November 2nd 04 05:50 PM


All times are GMT +1. The time now is 06:47 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"