PC Review


Reply
Thread Tools Rate Thread

Can Excel capture a screenshot?

 
 
Albert
Guest
Posts: n/a
 
      8th Sep 2008
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 With Quote
 
 
 
 
RB Smissaert
Guest
Posts: n/a
 
      8th Sep 2008
Have a look here:
http://allapi.mentalis.org/tips/capture.shtml

RBS


"Albert" <(E-Mail Removed)> wrote in message
news:0BE15659-A44C-4FD8-B1A7-(E-Mail Removed)...
> 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 With Quote
 
Peter T
Guest
Posts: n/a
 
      8th Sep 2008
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" <(E-Mail Removed)> wrote in message
news:0BE15659-A44C-4FD8-B1A7-(E-Mail Removed)...
> 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Capture screenshot of video automatically? VB Programmer Microsoft ASP .NET 2 30th Nov 2006 08:27 AM
Capture-A-ScreenShot Tramp Freeware 0 16th May 2006 04:21 PM
screenshot capture program winsnap tf76 Freeware 3 12th Mar 2006 04:16 PM
Polenta ScreenShot is a quick and easy-to-use screen capture utility Polenta ScreenShot Freeware 2 28th Jul 2004 08:43 AM
How to capture active window as screenshot? Dean Slindee Microsoft VB .NET 3 19th Jul 2004 07:16 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:09 PM.