Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 203
Default Can Excel capture a screenshot?

Hello!
Is it possible to have Excel capture a screenshot with the ontime procedure?
I'd like to have Excel and another application running simultaneously and
have Excel capture a screenshot every 5 minutes and paste it in the current
sheet.
Bonus: is it possible to capture a screenshot Only of the other application?
I thank you in advance,
Albert C.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Can Excel capture a screenshot?

Have a look he
http://allapi.mentalis.org/tips/capture.shtml

RBS


"Albert" wrote in message
...
Hello!
Is it possible to have Excel capture a screenshot with the ontime
procedure?
I'd like to have Excel and another application running simultaneously and
have Excel capture a screenshot every 5 minutes and paste it in the
current
sheet.
Bonus: is it possible to capture a screenshot Only of the other
application?
I thank you in advance,
Albert C.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Can Excel capture a screenshot?

Your question is rather vague, what application, will it be visible and the
be active-window, if so how to be sure, or maybe it has a handle, etc etc.

Try the following, after running StartCapture activate the window of your
application within 10 seconds

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 As Long = 44&
Private Const VK_LMENU As Long = 164&
Private Const KEYEVENTF_KEYUP As Long = 2&
Private Const KEYEVENTF_EXTENDEDKEY As Long = 1&

Dim mNextOnTime As Date

Sub StartCapture()
mNextOnTime = Now + TimeSerial(0, 0, 10) ' 10 seconds for testing
Application.OnTime mNextOnTime, "Capture"

End Sub

Sub StopCapture()
' cancel the ontime, eg call from the wb's close event
If mNextOnTime Then
Application.OnTime mNextOnTime, "Capture", , False
End If

End Sub

Sub Capture()
Dim tlRow As Long, brRow As Long
Dim shp As Shape
' like SendKeys Alt-PrtScn
keybd_event VK_LMENU, 0, KEYEVENTF_EXTENDEDKEY, 0
keybd_event VK_SNAPSHOT, 0, KEYEVENTF_EXTENDEDKEY, 0
keybd_event VK_SNAPSHOT, 0, KEYEVENTF_EXTENDEDKEY Or KEYEVENTF_KEYUP, 0
keybd_event VK_LMENU, 0, KEYEVENTF_EXTENDEDKEY Or KEYEVENTF_KEYUP, 0
DoEvents

For Each shp In ActiveSheet.Shapes
brRow = shp.BottomRightCell.Row
If brRow tlRow Then tlRow = brRow
Next

Cells(tlRow + 1, 2).Activate
ActiveSheet.Paste
ActiveCell.Activate

AppActivate Application.Caption

If MsgBox("Capture again in 10 seconds", vbYesNo) = vbYes Then
StartCapture
End If

End Sub

Regards,
Peter T


"Albert" wrote in message
...
Hello!
Is it possible to have Excel capture a screenshot with the ontime
procedure?
I'd like to have Excel and another application running simultaneously and
have Excel capture a screenshot every 5 minutes and paste it in the
current
sheet.
Bonus: is it possible to capture a screenshot Only of the other
application?
I thank you in advance,
Albert C.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel screen capture to capture cells and row and column headings jayray Excel Discussion (Misc queries) 5 November 2nd 07 11:01 PM
Excel marco to screenshot a user form automatically? [email protected] Excel Programming 4 February 4th 07 02:37 AM
ot check out a screenshot of excel 12 Gary Keramidas[_2_] Excel Programming 3 September 14th 05 03:39 AM
Take a screenshot Eugene Excel Programming 5 May 14th 04 10:43 AM
Automatic screenshot in Excel Jan K. Excel Programming 10 August 16th 03 03:34 PM


All times are GMT +1. The time now is 02:17 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"