Paste an Excel range in a specified slide into Powerpoint 
Author Message
 Paste an Excel range in a specified slide into Powerpoint

Hi,
I've program a macro for paste a selection range in Excel
into Powerpoint, but this Macro paste the selection into a
new slide.
Please help me for paste this selection into an existing
slide.

Thx

Start Code
-------------------------------------------
Sub RangeToPresentation()
Dim SheetName As Variant
Dim PPApp As PowerPoint.Application
Dim PPPres As PowerPoint.Presentation
Dim PPSlide As PowerPoint.Slide
Dim PresentationFileName As Variant
Dim CurrentTitle As Variant
Dim SlideCount As Long

Set PPApp = GetObject(, "Powerpoint.Application.8")
Set PPPres = PPApp.Presentations("COMIT1102_test.ppt")

CurrentTitle = "XL_To_PP" 'Titre ici
PresentationFileName = PPApp.ActivePresentation.Path
PresentationFileName = PresentationFileName & CurrentTitle
& ".ppt"

    SheetName = "Sept.02" 'Nom de la feuille Excel
    Selection.Copy
    SlideCount = PPPres.Slides.Count

    Set PPSlide = PPPres.Slides.Add(SlideCount + 1,
ppLayoutTable) 'I want to change this line for paste
               'into an existing slide  
        With PPSlide
            .Shapes.Paste
        End With
    SlideCount = SlideCount + 1
    With PPPres
        .SaveAs "Toto.ppt"
    End With

Set PPApp = Nothing
'Set PPPres = Nothing

End Sub
----------------------------------------------------
End code



Tue, 29 Mar 2005 16:19:01 GMT  
 Paste an Excel range in a specified slide into Powerpoint
I have never used powerpoint in my life,  but changing the
line :

Set PPSlide = ...

to

Set PPSlide = PPPres.Slides(slidecount)

should paste your Excel data in to the last slide. If this
is not the slide you want to paste the data in to, then
maybe you should offer the user a choice.

Regards

Rog

Quote:
>-----Original Message-----
>Hi,
>I've program a macro for paste a selection range in Excel
>into Powerpoint, but this Macro paste the selection into
a
>new slide.
>Please help me for paste this selection into an existing
>slide.

>Thx

>Start Code
>-------------------------------------------
>Sub RangeToPresentation()
>Dim SheetName As Variant
>Dim PPApp As PowerPoint.Application
>Dim PPPres As PowerPoint.Presentation
>Dim PPSlide As PowerPoint.Slide
>Dim PresentationFileName As Variant
>Dim CurrentTitle As Variant
>Dim SlideCount As Long

>Set PPApp = GetObject(, "Powerpoint.Application.8")
>Set PPPres = PPApp.Presentations("COMIT1102_test.ppt")

>CurrentTitle = "XL_To_PP" 'Titre ici
>PresentationFileName = PPApp.ActivePresentation.Path
>PresentationFileName = PresentationFileName &
CurrentTitle
>& ".ppt"

>    SheetName = "Sept.02" 'Nom de la feuille Excel
>    Selection.Copy
>    SlideCount = PPPres.Slides.Count

>    Set PPSlide = PPPres.Slides.Add(SlideCount + 1,
>ppLayoutTable) 'I want to change this line for paste
>               'into an existing slide  
>        With PPSlide
>            .Shapes.Paste
>        End With
>    SlideCount = SlideCount + 1
>    With PPPres
>        .SaveAs "Toto.ppt"
>    End With

>Set PPApp = Nothing
>'Set PPPres = Nothing

>End Sub
>----------------------------------------------------
>End code
>.



Tue, 29 Mar 2005 16:56:08 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How to paste a Excel.Chart to Powerpoint.Slides.Shape with VBA

2. Pasting Excel table into PowerPoint slide

3. Excel chart paste special to powerpoint slide

4. Using VBA to paste linked Excel range into Powerpoint

5. Specifying the paste range according to the target

6. Office 97 Excel to Powerpoint paste vs paste link

7. Macro for Powerpoint copy Charts from Excel Spread Sheet into PowerPoint slide

8. paste some text into embedded PowerPoint slide-xl2k

9. Pasting slides into New Powerpoint

10. Pasting slide from Word to PowerPoint (not the other way around)


 
Powered by phpBB® Forum Software © phpBB Group