Consulting

Results 1 to 3 of 3

Thread: VBA capturing screenshot

  1. #1
    VBAX Newbie
    Joined
    Nov 2017
    Posts
    4
    Location

    VBA capturing screenshot

    Need to get screenshots of powerpoints slides and paste it in excel using vba macro.
    Can anyone help in this regard?

  2. #2
    VBAX Guru mancubus's Avatar
    Joined
    Dec 2010
    Location
    "Where I lay my head is home" :D
    Posts
    2,644
    ?

    Sub vbax_62300_paste_PPSlides_as_pix_to_same_sheet()
        
        Dim i As Long
        
        ActiveSheet.Cells(1).Select
    
        With CreateObject("Powerpoint.Application")
            With .Presentations("MyOpenAndActivePresentationNameHere.pptx")
                For i = 1 To .Slides.Count
                    .Slides(i).Copy
                    ActiveSheet.Paste
                    ActiveCell.Offset(20).Select
                Next i
            End With
        End With
        
    End Sub
    PLS DO NOT PM; OPEN A THREAD INSTEAD!!!

    1) Posting Code
    [CODE]PasteYourCodeHere[/CODE]
    (or paste your code, select it, click # button)

    2) Uploading File(s)
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) (multiple files can be selected while holding Ctrl key) / Upload Files / Done
    Replace company specific / sensitive / confidential data. Include so many rows and sheets etc in the uploaded workbook to enable the helpers visualize the data and table structure. Helpers do not need the entire workbook.

    3) Testing the Codes
    always back up your files before testing the codes.

    4) Marking the Thread as Solved
    from Thread Tools (on the top right corner, above the first message)

  3. #3
    If below code is useful please change the thread heading to "Copy powerpoint slide to Excel sheet" or something similar.

    Sub gg()
        Dim pptApp As PowerPoint.Application
        
        Set pptApp = New PowerPoint.Application
        
        pptApp.Presentations.Open ("d:\presentation1.pptx") 'Note: Change file path.
        pptApp.ActivePresentation.Slides(1).Copy  'copy slide instead of capture. use your own slide number
        
        
        
        
         ActiveSheet.Paste 'paste from clipboard
         pptApp.Quit
     
    End Sub
    Last edited by J FelixBosco; 03-20-2018 at 07:39 AM.

Posting Permissions

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