

With the following code a freely selectable range (InputBox) is copied to PowerPoint. It is inserted with and without linkage. The file is stored in automatically determined "Temp - folder". The two pictures are from the "Object Browser" (F2 in VBE) of Powerpoint and show the possibilities of inserting. That is not the wisdom last conclusion - however it functions. The files at the end of the article are Excelfiles of the version 2003 and 2007.
The following code belonged in "Module1"
Option Explicit
Private Declare Function GetTempPath Lib "kernel32" Alias _
"GetTempPathA" (ByVal strBufferLength As Long, ByVal _
lpBuffer As String) As Long
Const strPPSave As String = "Test.ppt"
Public Sub Test()
Dim strFileName As String
Dim objPPRange As Object
Dim objPPApp As Object
Dim objSlide As Object
Dim varTMP As Variant
On Error GoTo Fin
Set varTMP = Application.InputBox _
("Range select.", "Select", , , , , , 8)
Set objPPApp = CreateObject("PowerPoint.Application")
With objPPApp
.Visible = True
.Presentations.Add
.ActivePresentation.Slides.Add 1, 12
ThisWorkbook.Worksheets(varTMP.Parent.Name).Range _
(varTMP.Address).CopyPicture
Set objSlide = .ActivePresentation.Slides(1)
Set objPPRange = objSlide.Shapes.Paste
With objPPRange
.LockAspectRatio = False
.Width = objSlide.Design.SlideMaster.Width
.Height = objSlide.Design.SlideMaster.Height
.Align 4, True
.Align 1, True
End With
Tabelle1.Range(varTMP.Address).Copy
.ActivePresentation.Slides.Add 2, 12
.ActiveWindow.View.GotoSlide (2)
.ActiveWindow.View.PasteSpecial 10, , , , , -1
.ActivePresentation.Slides.Add 3, 12
.ActiveWindow.View.GotoSlide (3)
.ActiveWindow.View.PasteSpecial 2
strFileName = PP_Save
.ActivePresentation.SaveAs strFileName & strPPSave
End With
Fin:
Application.CutCopyMode = False
Set objPPRange = Nothing
Set objPPApp = Nothing
Set objSlide = Nothing
End Sub
Private Function PP_Save() As String
Dim strBuffer As String
Dim lngReturn As Long
strBuffer = Space(255)
lngReturn = GetTempPath(255, strBuffer)
If lngReturn > 0 Then
PP_Save = Left$(strBuffer, lngReturn)
Else
PP_Save = CurDir$
End If
If Right(PP_Save, 1) <> "\" Then PP_Save = PP_Save & "\"
End Function
Sample 2003
Sample 2007