- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Print screen using VBA in SAP
If you are using SendKeys then avoid using it. I had used it in the past project and it seems to be inconsistent and error-prone.
You can use the below snippet at the top of the module and call it wherever required.
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 KEYEVENTF_KEYUP = &H2 Private Const VK_SNAPSHOT = &H2C Private Const VK_MENU = &H12 Sub PrintScreen() keybd_event VK_SNAPSHOT, 1, 0, 0 End Sub
Advertisements