• Excel Worksheet to PPT (Office XP)

    Author
    Topic
    #406654

    I have created an excel worksheet that incorporates a graph with a grid containing the data next to it. I need to take that worksheet, exactly as it is, and put it into a Powerpoint slide. How can I accomplish this?

    Viewing 1 reply thread
    Author
    Replies
    • #844912

      A worksheet is a bit large to fit into a PowerPoint slide “exactly as it is” (65536 rows by 256 columns). But you can select the range you want to show, including the chart, and copy a picture to the clipboard by holding Shift down while selecting the Edit menu; the Copy item will change to Copy Picture. You can paste the picture into a slide.

      • #845012

        Also, regretfully, the ‘copy as picture’ trick won’t handle a whole 256 x 65536-cell worksheet. Depressingly much less. Pity, as one use for this trick is to send gen to other folk in a way which is completely uneditable.
        Well, I’m sure there are folk here who could do it, but not we ordinary chaps.

      • #845013

        Also, regretfully, the ‘copy as picture’ trick won’t handle a whole 256 x 65536-cell worksheet. Depressingly much less. Pity, as one use for this trick is to send gen to other folk in a way which is completely uneditable.
        Well, I’m sure there are folk here who could do it, but not we ordinary chaps.

      • #845594

        I picked up this handy code, and attached to a toolbar because I use it so often.
        (Source: at the bottom of the page http://peltiertech.com/Excel/XL_PPT.html%5B/url%5D )

        Sub RangeToPresentation()
        ' Set a VBE reference to Microsoft PowerPoint 10.0 Object Library for Office 2002,
        
        Dim PPApp As PowerPoint.Application
        
        Dim PPPres As PowerPoint.Presentation
        Dim PPSlide As PowerPoint.Slide
        
        ' Make sure a range is selected
        If Not TypeName(Selection) = "Range" Then
            MsgBox "Please select a worksheet range and try again.", vbExclamation, _
                "No Range Selected"
        Else
            ' Reference existing instance of PowerPoint 2002
            Set PPApp = GetObject(, "Powerpoint.Application.10")
            ' Reference active presentation
            Set PPPres = PPApp.ActivePresentation
            PPApp.ActiveWindow.ViewType = ppViewSlide
            ' Reference active slide
            Set PPSlide = PPPres.Slides(PPApp.ActiveWindow.Selection.SlideRange.SlideIndex)
            
            ' Copy the range as a piicture
            Selection.CopyPicture Appearance:=xlScreen, _
                Format:=xlPicture
        
            ' Paste the range
            PPSlide.Shapes.Paste.Select
            
            ' Align the pasted range
            PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignCenters, True
            PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignMiddles, True
        
            ' Clean up
            Set PPSlide = Nothing
            Set PPPres = Nothing
            Set PPApp = Nothing
        End If
        
        End Sub
        

        I also have one for Chart ot PPT.

        • #845600

          That will certainly come in handy if you have to do it often.

          • #845842

            Here is the corresponding one for charts:
            (Source: at the bottom of the page http://peltiertech.com/Excel/XL_PPT.html%5B/url%5D )

            Sub ChartToPresentation()
            ' Set a VBE reference to Microsoft PowerPoint 10.0 Object Library for Office 2002,
            
            Dim PPApp As PowerPoint.Application
            Dim PPPres As PowerPoint.Presentation
            Dim PPSlide As PowerPoint.Slide
            
            ' Make sure a chart is selected
            If ActiveChart Is Nothing Then
                MsgBox "Please select a chart and try again.", vbExclamation, _
                    "No Chart Selected"
            Else
                ' Reference existing instance of PowerPoint 2002
                Set PPApp = GetObject(, "Powerpoint.Application.10")
                ' Reference active presentation
                Set PPPres = PPApp.ActivePresentation
                PPApp.ActiveWindow.ViewType = ppViewSlide
                ' Reference active slide
                Set PPSlide = PPPres.Slides _
                    (PPApp.ActiveWindow.Selection.SlideRange.SlideIndex)
                
                ' Copy chart as a picture
                ActiveChart.CopyPicture Appearance:=xlScreen, Size:=xlScreen, _
                    Format:=xlPicture
            
                ' Paste chart
                PPSlide.Shapes.Paste.Select
                
                ' Align pasted chart
                PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignCenters, True
                PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignMiddles, True
            
                ' Clean up
                Set PPSlide = Nothing
                Set PPPres = Nothing
                Set PPApp = Nothing
            End If
            
            
            • #845847

              Thanks for sharing it.

            • #845926

              I will try to locate the source of the code, also. [EDIT: I included the links to Jon Peltier’s web site). I modified it to use XL2002 rather than XL97.]

              Since I use a Mac at home, I tried these codes in Excel 2001 (Mac OS 9.2.2), and had to slightly modify them:

              I had to change one line in each.

              Set PPApp = GetObject(, “Powerpoint.Application”)

              (Remove the reference to Office Number)

            • #845848

              Thanks for sharing it.

        • #845601

          That will certainly come in handy if you have to do it often.

      • #845595

        I picked up this handy code, and attached to a toolbar because I use it so often.
        (Source: at the bottom of the page http://peltiertech.com/Excel/XL_PPT.html%5B/url%5D )

        Sub RangeToPresentation()
        ' Set a VBE reference to Microsoft PowerPoint 10.0 Object Library for Office 2002,
        
        Dim PPApp As PowerPoint.Application
        
        Dim PPPres As PowerPoint.Presentation
        Dim PPSlide As PowerPoint.Slide
        
        ' Make sure a range is selected
        If Not TypeName(Selection) = "Range" Then
            MsgBox "Please select a worksheet range and try again.", vbExclamation, _
                "No Range Selected"
        Else
            ' Reference existing instance of PowerPoint 2002
            Set PPApp = GetObject(, "Powerpoint.Application.10")
            ' Reference active presentation
            Set PPPres = PPApp.ActivePresentation
            PPApp.ActiveWindow.ViewType = ppViewSlide
            ' Reference active slide
            Set PPSlide = PPPres.Slides(PPApp.ActiveWindow.Selection.SlideRange.SlideIndex)
            
            ' Copy the range as a piicture
            Selection.CopyPicture Appearance:=xlScreen, _
                Format:=xlPicture
        
            ' Paste the range
            PPSlide.Shapes.Paste.Select
            
            ' Align the pasted range
            PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignCenters, True
            PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignMiddles, True
        
            ' Clean up
            Set PPSlide = Nothing
            Set PPPres = Nothing
            Set PPApp = Nothing
        End If
        
        End Sub
        

        I also have one for Chart ot PPT.

    • #844913

      A worksheet is a bit large to fit into a PowerPoint slide “exactly as it is” (65536 rows by 256 columns). But you can select the range you want to show, including the chart, and copy a picture to the clipboard by holding Shift down while selecting the Edit menu; the Copy item will change to Copy Picture. You can paste the picture into a slide.

    Viewing 1 reply thread
    Reply To: Excel Worksheet to PPT (Office XP)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: