Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default trying to use print screen.

Nick,
i forgot to mention....i rated you as excellent...which you deserve....
Thanks again for you effort.

musa.biralo


NickHK wrote:
This seems to works in Excel although there some inconsistencies if
- The VBE window is under the Excel window
- Excel is not always returned with focus; so Appactivate
Your should add error trapping also. As the API call has no return value for
success, you cannot tell if there is anything valid to PasteSpecial until
you try.

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

Private Sub CommandButton1_Click()
Dim PrevState As XlWindowState

PrevState = Application.WindowState
Application.WindowState = xlMinimized

keybd_event VK_SNAPSHOT, 0, 0, 0

Application.WindowState = PrevState
'Excel is not always returned with focus, so
AppActivate Application.Caption

With ActiveSheet
.Range("A1").Select
.PasteSpecial Format:="Bitmap"
End With

End Sub

NickHK

"musa.biralo" wrote in message
oups.com...
Hi,
I am trying to,
1) Minimize the excel.
2) Press "Print Screen"
3) Come back to same excel.
4) Paste it in the excel

Problem is how can i send the Print Screen command...when excel is
minimized there could be any application running.....

Your help will highly be appreciated.
Thanks

musa.biralo


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
can't print data labels - on screen but don't print out Linda Charts and Charting in Excel 1 June 27th 09 07:11 PM
Why does it not print how is it on screen? JackieB80 Excel Discussion (Misc queries) 2 October 16th 08 04:28 PM
Print Screen Richard Excel Discussion (Misc queries) 4 March 3rd 08 03:28 PM
print box opens in right screen of dual screen setup why gerrys Excel Discussion (Misc queries) 1 June 30th 06 06:47 PM
Print and Print Preview don't match screen JNohl Excel Worksheet Functions 0 March 11th 05 05:23 PM


All times are GMT +1. The time now is 09:36 AM.

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"