ThrottleWorks
Excel Ninja
Hi,
I am trying to get screenshot of active worksheet.
Below code is written in this workbook.
Before calling this module, another workbook is opened.
When I run this code by doing F5, I get screenshot of ThisWorkbook and not activeworkbook.
If I run code by doing F8, I get screen of code window.
How do I get screenshot of activeworksheet.
Can anyone please help me in this.
Also, when I run this code, NUMLOCK gets off. Do not know why.
I am trying to get screenshot of active worksheet.
Below code is written in this workbook.
Before calling this module, another workbook is opened.
When I run this code by doing F5, I get screenshot of ThisWorkbook and not activeworkbook.
If I run code by doing F8, I get screen of code window.
How do I get screenshot of activeworksheet.
Can anyone please help me in this.
Also, when I run this code, NUMLOCK gets off. Do not know why.
Code:
Option Explicit
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal _
bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Private Const VK_SNAPSHOT = &H2C
Sub PrintScreen()
Application.SendKeys "({1068})", True
DoEvents
ActiveSheet.Paste
End Sub