PDA

View Full Version : VBA capturing screenshot



green99
03-20-2018, 12:51 AM
Need to get screenshots of powerpoints slides and paste it in excel using vba macro.
Can anyone help in this regard?

mancubus
03-20-2018, 05:06 AM
?



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

J FelixBosco
03-20-2018, 05:16 AM
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