Results 1 to 6 of 6
  1. #1
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Illinois
    Posts
    552
    Thanks
    0
    Thanked 1 Time in 1 Post

    PPT vba pastespecial from Excel (Excel xp, 2003)

    I tried to do a macro from excel to paste special A1:M33 into ppt. It wouldn't record once i got to powerpoint. What is the code to paste link from excel to ppt? Thank you

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: PPT vba pastespecial from Excel (Excel xp, 2003)

    Is PowerPoint already open, or should it be opened by the macro?
    If it is open, is there a presentation open, or should the macro create a new one?
    If there is an open presentation, should the cells be pasted into the current slide, or should the macro create a new one?

  3. #3
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Illinois
    Posts
    552
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: PPT vba pastespecial from Excel (Excel xp, 2003)

    oh, thanks.

    no ppt is not open and a new slide has to be added between 7 and 8 where the excel cells get paste linked. thanks for th ehelp

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: PPT vba pastespecial from Excel (Excel xp, 2003)

    > ppt is not open and a new slide has to be added between 7 and 8

    Between 7 and 8 of what? <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

  5. #5
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Illinois
    Posts
    552
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: PPT vba pastespecial from Excel (Excel xp, 2003)

    open ppt, insert a new slide. Sorry, didn't mean between 7 and 8. forget that part

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: PPT vba pastespecial from Excel (Excel xp, 2003)

    Try this:

    Sub Test()
    Dim pptApp As Object

    On Error GoTo ErrHandler

    ActiveSheet.Range("A1:M33").Copy
    Set pptApp = CreateObject("PowerPoint.Application")
    pptApp.WindowState = 3 ' ppWindowMaximized
    pptApp.Visible = True
    pptApp.Presentations.Add.Slides.Add Index:=1, Layout:=12 ' ppLayoutBlank
    pptApp.ActiveWindow.View.PasteSpecial DataType:=10, Link:=True ' ppPasteOLEObject

    ExitHandler:
    Set pptApp = Nothing
    Exit Sub

    ErrHandler:
    MsgBox Err.Description, vbExclamation
    Resume ExitHandler
    End Sub

Posting Permissions

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