hi the following code works wonders although before creating a blank new sheet for pasting the screen grab it brings the wrong date and time.
what amendment is required to ensure the exact current time date is changed before the screen copy to paste in a new sheet
this is the 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 KEYEVENTF_KEYUP = &H2
Private Const VK_SNAPSHOT = &H2C
Private Const VK_MENU = &H12
Private Declare PtrSafe Sub Sleep Lib "kernel32.dll" ( _
ByVal dwMilliseconds As Long)
________________________________________________________________
Private Sub CommandButton2_Click()
keybd_event VK_MENU, 0, 0, 0
keybd_event VK_SNAPSHOT, 0, 0, 0
keybd_event VK_SNAPSHOT, 0, KEYEVENTF_KEYUP, 0
keybd_event VK_MENU, 0, KEYEVENTF_KEYUP, 0
ActiveSheet.Unprotect "6477"
Sheets("STATUS").Range("l2").Value = Now
ActiveSheet.Protect "6477"
Sheets.Add
MsgBox ("Screen Captured - Paste to new sheet")
End Sub
what amendment is required to ensure the exact current time date is changed before the screen copy to paste in a new sheet
this is the 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 KEYEVENTF_KEYUP = &H2
Private Const VK_SNAPSHOT = &H2C
Private Const VK_MENU = &H12
Private Declare PtrSafe Sub Sleep Lib "kernel32.dll" ( _
ByVal dwMilliseconds As Long)
________________________________________________________________
Private Sub CommandButton2_Click()
keybd_event VK_MENU, 0, 0, 0
keybd_event VK_SNAPSHOT, 0, 0, 0
keybd_event VK_SNAPSHOT, 0, KEYEVENTF_KEYUP, 0
keybd_event VK_MENU, 0, KEYEVENTF_KEYUP, 0
ActiveSheet.Unprotect "6477"
Sheets("STATUS").Range("l2").Value = Now
ActiveSheet.Protect "6477"
Sheets.Add
MsgBox ("Screen Captured - Paste to new sheet")
End Sub