I have a list of URLs in range A1:A60. I want to open each, take a screenshot of the website, close the website and save the screenshot in jpg format.
I'm using my secondary monitor to take a screenshot because I have changed the settings on that to Portrait (not Landscape) in order to capture lengthy articles.
I have tried to make it work with the below code but it returns a blank jpg image.
Option Explicit
'Declare Windows API Functions
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal _
bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
'Declare Virtual Key Codes
Private Const VK_SNAPSHOT = &H2C
Sub PrintScreen()
Dim Address As String
Address = Range("A1").Value
ActiveWorkbook.FollowHyperlink Address, , True
AppActivate "Google Chrome"
keybd_event VK_SNAPSHOT, 1, 0, 0
ActiveSheet.Paste
Charts.Add
Charts(1).AutoScaling = True
Charts(1).Paste
Charts(1).Export Filename:="C:\Users\user\Desktop\0coding\Excel (Visual Basic)\ClipBoardToPic.jpg", FilterName:="jpg"
Charts(1).Delete
End Sub