VBA to loop through URLs specified in sheet. Open each URL, take screenshot and save as JPG/PNG

Viewed 27

So far I managed to make the Macro open as many URLs as I include in the excel with this.

Option Explicit

Sub OpenUrls()
    ThisWorkbook.FollowHyperlink Sheet1.Range("A2").Value
    Application.Wait Now + TimeValue("00:00:02")
    
    Dim i As Long
    Dim url As String
    For i = 3 To 5
        url = Sheet1.Cells(i, 1).Value
        SendKeys "^t"
        Application.Wait Now + TimeValue("00:00:02")
        SendKeys url & "{ENTER}" '"~"
        Application.Wait Now + TimeValue("00:00:02")
    Next i
    
End Sub

I need something in the middle so it takes an screenshot of every website that opens and saves it as a JPG or PNG.

0 Answers
Related