How to capture screen through VBA?

B

Bill Choy

Hi,

I'm doing a program for generating report in excel. One of
the steps is capture the active window screen and paste it
in a worksheet. I have to push Alt-PrintScreen to capture
screen before running the report generation program. The
following code is used to copy the screen capture.

Set NewWb = Workbooks.Add
NewWb.Sheets(3).Activate
Sheets("Sheet3").Select
Range("A1").Select
ActiveSheet.Paste

I don't want to push Alt-PrintScreen every time. Are there
any methods to copy the screen automatically?

Best regards
Bill
 
T

Tim Coddington

Snaggit did look interesting
I wonder if there is any way to use 'SendKeys' to send Alt PrintScreen to
Windows?

Syntax

SendKeys string[, wait]

That might be just what the doctor ordered without having to access
another package.
 
K

keepITcool

funny though it is:

VB6 can simply sendkeys {PrtSc}
VBA cant do it..
(Word has a workaround)

see API code in referenced thread.

--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Tim Coddington wrote :
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top