Here is some code from a previous post. The code is from
Andy Pope
http://vbaexpress.com/forum/showthread.php?t=12436
[VBA]
Sub MakeSlide()
Dim PPApp As Object
Dim PPPres As PowerPoint.Presentation
Dim PPSlide As PowerPoint.Slide
' On Error Resume Next
Set PPApp = CreateObject("Powerpoint.Application")
PPApp.Visible = True
If Err.Number <> 0 Then
Err.Clear
On Error Goto ErrHandler
With PPApp
.Visible = True
' not require as it causes 2 presentations
'''' .Presentations.Add
End With
Else
On Error Goto ErrHandler
End If
With PPApp.Presentations.Add
.Slides.Add Index:=1, Layout:=ppLayoutTitle
End With
Set PPPres = PPApp.ActivePresentation
Set PPSlide = PPPres.Slides(PPApp.ActiveWindow.Selection.SlideRange.SlideIndex)
With PPPres.PageSetup
.SlideSize = ppSlideSizeCustom
.SlideWidth = 720
.SlideHeight = 576
.FirstSlideNumber = 1
.SlideOrientation = msoOrientationHorizontal
.NotesOrientation = msoOrientationVertical
End With
PPApp.ActiveWindow.ViewType = ppViewSlide
Selection.CopyPicture Appearance:=xlScreen, Format:=xlPicture
PPApp.ActiveWindow.Selection.SlideRange.Shapes.SelectAll
PPApp.ActiveWindow.Selection.ShapeRange.Delete
PPSlide.Shapes.Paste.Select
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignCenters, True
PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignMiddles, True
MsgBox ("Don't forget to save your new PowerPoint slide.")
PPPres.Close
PPApp.Quit
ErrHandler:
Set PPSlide = Nothing
Set PPPres = Nothing
Set PPApp = Nothing
On Error Goto 0
End Sub
[/VBA]
This verion of VBA works on my programs. Now I got to work on the next items that will improve my objective.
1. If I want to keep the Power Point open so I put the apostriphy in fron of the three lines below. and that seamed to work.
[VBA]
'MsgBox ("Don't forget to save your new PowerPoint slide.")
'PPPres.Close
'PPApp.Quit
[/VBA]
2. I will have Power Point open and the first slide created. I need the sub to add selected cell in excel to the next slide. and so on. These slides will be during periods of non data enter in the spreadsheet.
3 I need to max the size if the slide and make it bolder(font).
mike in wisconsin