Results 1 to 2 of 2
  1. #1
    Lounger
    Join Date
    Feb 2009
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Copy excel chart to power point (from 2003 to 2007)

    Macro below created in 2003 version will not run on 2007 version.
    What command to I use in 2007 to replace the line that crashes below?

    Sub PowerPointChart()
    Set B = Sheets("Sheet4")
    Set ppApp = GetObject(, "PowerPoint.Application")

    B.Shapes("Chart 8").Select
    Selection.CopyPicture Appearance:=xlScreen, Format:=xlPicture '<<<<2007 version crashes at this line
    ppApp.ActiveWindow.View.Paste

    End Sub

  2. #2
    WS Lounge VIP
    Join Date
    Mar 2002
    Location
    Newcazzle, UK
    Posts
    2,826
    Thanks
    136
    Thanked 482 Times in 459 Posts

    Re: Copy excel chart to power point (from 2003 to 2007)

    This worked for me:

    Sub PowerPointChart()
    Set B = Sheets("Sheet4")
    Set ppApp = GetObject(, "PowerPoint.Application")

    B.Shapes("Chart 8").Select
    'Selection.CopyPicture Appearance:=xlScreen, Format:=xlPicture '<<<<2007 version crashes at this line
    ActiveChart.ChartArea.Copy '<<<< changed to this

    ppApp.ActiveWindow.View.Paste

    End Sub


    This requires that you ave Powerpoint open already and are on a blank slide.


    zeddy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •