Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Macro to generate powerpoint slides

Also, I did play with the excel code a bit and it generates the
PowerPoint presentation and the first slide, but it does not open the
files


As I mentioned.., I don't work with PPT and so any code relating to it
should be asked in a PPT group. That said, after looking at the code it
appears to create a new Presentation for each file when what I think
you want is 1 presentation consisting of slides inserted from the
source files...

'[XL routine]
Sub CreatePowerPoint()
Dim vList, n&

vList = ActiveSheet.Range("A1:A5")
On Error GoTo Cleanup
'Automate a new instance of PowerPoint
With CreateObject("PowerPoint.Application")
.Visible = True
'Add a new presentation
With .Presentations.Add
For n = LBound(vList) To UBound(vList)
'Insert the files into the slide
.slides.InsertFromFile vFile(n, 1), .slides.Count + 1
Next 'n
End With '.Presentations.Add
End With 'CreateObject
Cleanup:
End Sub

Sub InsertSlidesFromFile()
' Inserts slides from a list of PPTs stored in a txt file
Dim vList, n&
Const sPath$ = "C:\documents\"

vList = Split(ReadTextFile(sPath & "TestPP.txt"), vbCrLf)
On Error GoTo Cleanup
'Add a new presentation
With Application.Presentations.Add
For n = LBound(vList) To UBound(vList)
'Insert the files into the slide
.slides.InsertFromFile sPath & vFile(n), .slides.Count + 1
Next 'n
End With 'Application.Presentations.Add
Cleanup:
End Sub

'[PPT routines]
Sub InsertSlidesFromFolder()
' Inserts slides from a list of PPTs stored in a txt file
Dim vFile, n&
Const sPath$ = "C:\documents\"

vFile = Dir(sPath)
On Error GoTo Cleanup
'Add a new presentation
With Application.Presentations.Add
Do While Len(vFile)
'Insert the slide into the presentation
.slides.InsertFromFile sPath & vFile, .slides.Count + 1
vFile = Dir()
Loop
End With 'Application.Presentations.Add
Cleanup:
End Sub

Sub ReformatBankAmounts()
Dim c As Range
For Each c In Selection
c = Format(c / 1000, "000.000")
Next 'c
End Sub

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Macro to generate powerpoint slides

Please revise sPath to your actual folder location...

"C:\Users\Marty\Documents\"

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Macro to generate powerpoint slides

Oops.., too many subs AND properly located section marker for PPT
subs...

'[XL routine]
Sub CreatePowerPoint()
Dim vList, n&

vList = ActiveSheet.Range("A1:A5")
On Error GoTo Cleanup
'Automate a new instance of PowerPoint
With CreateObject("PowerPoint.Application")
.Visible = True
'Add a new presentation
With .Presentations.Add
For n = LBound(vList) To UBound(vList)
'Insert the files into the slide
.slides.InsertFromFile vFile(n, 1), .slides.Count + 1
Next 'n
End With '.Presentations.Add
End With 'CreateObject
Cleanup:
End Sub

'[PPT routines]
Sub InsertSlidesFromFile()
' Inserts slides from a list of PPTs stored in a txt file
Dim vList, n&
Const sPath$ = "C:\documents\"

vList = Split(ReadTextFile(sPath & "TestPP.txt"), vbCrLf)
On Error GoTo Cleanup
'Add a new presentation
With Application.Presentations.Add
For n = LBound(vList) To UBound(vList)
'Insert the files into the slide
.slides.InsertFromFile sPath & vFile(n), .slides.Count + 1
Next 'n
End With 'Application.Presentations.Add
Cleanup:
End Sub

Sub InsertSlidesFromFolder()
' Inserts slides from a list of PPTs stored in a txt file
Dim vFile, n&
Const sPath$ = "C:\documents\"

vFile = Dir(sPath)
On Error GoTo Cleanup
'Add a new presentation
With Application.Presentations.Add
Do While Len(vFile)
'Insert the slide into the presentation
.slides.InsertFromFile sPath & vFile, .slides.Count + 1
vFile = Dir()
Loop
End With 'Application.Presentations.Add
Cleanup:
End Sub


--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Macro to generate powerpoint slides

I see the missing backslash. My apologies. I will update and run. another apology as I misstated the info about the txt file and the paths of the files. They are all full path names with the file extensions. Same with the Excel file. Ill work on these and update. Cheers for the quick response.
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
Powerpoint slides from Excel pages Tigerxxx Excel Discussion (Misc queries) 2 March 16th 09 08:06 PM
where do u get slides for microsoft powerpoint 2003? slides for microsoft powerpoint 2003 Excel Discussion (Misc queries) 2 October 16th 08 02:00 PM
Powerpoint slides to be used in excel macros Vijay Kotian Excel Discussion (Misc queries) 1 November 30th 06 07:44 AM
Excel formulas on different Powerpoint Slides liseladele Excel Worksheet Functions 0 June 1st 06 12:28 AM
Generate powerpoint slides from excel automatically Héctor Balanzar Excel Programming 1 December 31st 03 01:16 PM


All times are GMT +1. The time now is 09:25 AM.

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"