I am creating a macro that will capture a screen with keyboard events. After that, it will save the screenshot to an Excel file.
Here is the code:
DoEvents
keybd_event VK_SNAPSHOT, 0, KEYEVENTF_EXTENDEDKEY, 0&
keybd_event VK_SNAPSHOT, 0, KEYEVENTF_EXTENDEDKEY Or KEYEVENTF_KEYUP, 0&
DoEvents
capturesFile.Worksheets(capturesFile.Worksheets.Count).Paste Destination:=curWS.Cells(rowNum + 2, 2)
I want my macro to save the same screenshot as a JPG file in a folder, before saving it to the Excel file.
More information: I am capturing any random screen (Desktop, Skype, Outlook, some folder, some Web page, it could be anything.) I want to save the screenshot to a folder. Saving the screenshot as a JPG file has no relation with the Excel file.
Can you please help me?