Results 1 to 4 of 4

Thread: Saving Active Powerpoint using Excel
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    New Member
    Join Date
    Jun 2019
    Posts
    17
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Saving Active Powerpoint using Excel

    Hello hope everyone is well! I am trying to create a macro code to save a powerpoint that I have active and opened I have tried several methos but each one I get different error. So far this is the code that I have as well as the defined parameters. Please let me know if you have any feed back thank you!!!
    Sub PowerpointRO()
    '
    ' PowerpointUpdate Macro
    '
    Const nPos As Integer = 13 ' #slide
    Dim rng As Range
    Set rng = Sheets("Risk & Opp").Range("A1:K10")
    Dim obj As Powerpoint.Application
    Set obj = CreateObject("Powerpoint.Application")
    Dim pre As Presentation
    Dim sld As Slide
    Dim sH
    Dim sW
    Set obj = CreateObject("Powerpoint.Application")
    Application.ScreenUpdating = False
    Dim sFile
    sFile = "S:\Projects\2.2 Work products\2.2.2 Systems Engineering\2.2.2.9 Dashboard\Dashboard\Project Report.pptx"
    Set pre = obj.Presentations.Open(sFile)
    obj.ActiveWindow.View.GotoSlide nPos
    Set sld = pre.Slides(nPos)
    rng.Copy
    sld.Shapes.PasteSpecial DataType:=2
    Application.CutCopyMode = False
    With pre.PageSetup
    sH = .SlideHeight
    sW = .SlideWidth
    End With
    With obj.ActiveWindow.Selection.ShapeRange
    .Width = 400
    .Align msoAlignCenters, True
    .Align msoAlignMiddles, True
    End With
    Application.ScreenUpdating = True
    'obj.Quit
    End Sub

    Sub PowerpointAL()
    '
    ' PowerpointUpdate Macro
    '
    Sub SavePPT()
    Windows("Project Reporet Dasboard").Activate
    ActiveWorkbook.SaveAs fileName:= _
    ("S:\Projects\2.2 Work products\2.2.2 Systems Engineering\2.2.2.9 Dashboard\Dashboard\Project Report Dashboard" & Format(Now(), YYYY.MM.DD) & ".xlsm")
    ActiveWorkbook.SaveAs fileName:= _
    ("S:\Projects\2.2 Work products\2.2.2 Systems Engineering\2.2.2.9 Dashboard\Dashboard\Archive\Project Report Dashboard" & Format(Now(), YYYY.MM.DD) & ".xlsm")
    End Sub
    I am hoping to save the power point in two different folders. Let me know if I can help in anyway!

  2. #2
    New Member
    Join Date
    Jun 2019
    Posts
    17
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Saving Active Powerpoint Uisng Excel

    this reply was deleted
    Last edited by ktkelly_1; Jun 19th, 2019 at 01:19 PM.

  3. #3
    New Member
    Join Date
    Jun 2019
    Posts
    17
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Saving Active Powerpoint Uisng Excel

    this reply was deleted
    Last edited by ktkelly_1; Jun 19th, 2019 at 01:27 PM.

  4. #4
    New Member
    Join Date
    Jun 2019
    Posts
    17
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Saving Active Powerpoint Uisng Excel

    Quote Originally Posted by ktkelly_1 View Post
    Sub SavePPT()
    Windows("Project Reporet Dasboard").Activate
    ActiveWorkbook.SaveAs fileName:= _
    ("S:\Projects\2.2 Work products\2.2.2 Systems Engineering\2.2.2.9 Dashboard\Dashboard\Project Report Dashboard" & Format(Now(), YYYY.MM.DD) & ".xlsm")
    ActiveWorkbook.SaveAs fileName:= _
    ("S:\Projects\2.2 Work products\2.2.2 Systems Engineering\2.2.2.9 Dashboard\Dashboard\Archive\Project Report Dashboard" & Format(Now(), YYYY.MM.DD) & ".xlsm")
    End Sub
    this is actually the wrong coding for power point specific but it is still messed up saying object required, but I have used this in the past and never had a problem so I'm not sure what the problem is.

    the code that I do need edited is actually the one below along with the one above.
    Sub SavePPT()
    Dim ppPres As Presentation
    Dim fileNameString As String
    Dim ppApp As Powerpoint.Application


    Dim obj As Powerpoint.Application


    fileNameString1 = "S:\Projects\STV_Plus\2 Project Execution Data\2.2 Work products\2.2.2 Systems Engineering\2.2.2.9 Dashboard\Dashboard\Project Report - " & Format(Now(), "YYYY.MM.DD") & ".pptx" '<change to your file path/name
    fileNameString2 = "S:\Projects\STV_Plus\2 Project Execution Data\2.2 Work products\2.2.2 Systems Engineering\2.2.2.9 Dashboard\Dashboard\Archive\Project Report - " & Format(Now(), "YYYY.MM.DD") & ".pptx"




    'Create an instance of PPT to work with
    Set ppApp = CreateObject("Powerpoint.Application")
    ppApp.Visible = True


    'Create a new presentation (or you can access an existing file with ppApp.Presentations.Open


    'Save:
    ActivePresentation.SaveCopyAs fileName:=fileNameString1
    ActivePresentation.SaveCopyAs fileName:=fileNameString2




    End Sub

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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