screen capture

firexcel

New Member
Joined
Jan 2, 2007
Messages
10
is this even possible >

click a command button which does a screen grab and saves to a new sheet - tab labelled as the time - time capture taken

want a history so potential for a number new sheets

the sheet is protected, colourful as a display screen and contains command buttons
 
Last edited:

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
try:
Code:
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
Public Declare Function OpenClipboard Lib "user32" (ByVal hwnd As Long) As Long
Public Declare Function EmptyClipboard Lib "user32" () As Long
Public Declare Function CloseClipboard Lib "user32" () As Long




Sub aScreenPrint()
On Error Resume Next
Const CF_BITMAP = 0
    Range("A4").Select
    'SendKeys "{prtsc}"
   
    Call ClearClipboard
    ScreenCap
    
    Sheets.Add
    Range("A1").Select
    SendKeys "^{v}"
End Sub


Private Sub ScreenCap()
    keybd_event VK_SNAPSHOT, 1, 0, 0
End Sub


Private Function ClearClipboard()
    OpenClipboard (0&)
    EmptyClipboard
    CloseClipboard
End Function
 
Upvote 0
trouble is I have this in the sheet so not sure if that will work adding in extra code


Private Declare PtrSafe Sub Sleep Lib "kernel32.dll" ( _
ByVal dwMilliseconds As Long)


Public Sub mySleep()
Do
Application.Calculate


Call Sleep(2000) '2000 Millisekunden Pause
Loop
End Sub




End Sub

Private Sub CommandButton1_Click()
Sheet1.Select

Do
Application.Calculate


Call Sleep(2000) '2000 Millisekunden Pause
Loop
End Sub
 
Upvote 0
It's fine if you're adding a command button use an active x one and then right click it to select the code module and put it in there.

It will run separately to the other code and only when you click the button!
 
Upvote 0
Shouldn't be a problem.

Ranman256 s solution should work for both

If you're worried about breaking the original work book save a copy to a different location and work with that. If something goes wrong you have the original top fall back on.
 
Upvote 0

Forum statistics

Threads
1,223,910
Messages
6,175,318
Members
452,634
Latest member
cpostell

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top