• PPT vba pastespecial from Excel (Excel xp, 2003)

    Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » PPT vba pastespecial from Excel (Excel xp, 2003)

    • This topic has 5 replies, 2 voices, and was last updated 20 years ago.
    Author
    Topic
    #419508

    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

    Viewing 0 reply threads
    Author
    Replies
    • #947452

      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?

      • #947470

        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

        • #947478

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

          Between 7 and 8 of what? scratch

          • #947551

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

            • #947559

              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

    Viewing 0 reply threads
    Reply To: PPT vba pastespecial from Excel (Excel xp, 2003)

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

    Your information: