LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default scraping text from the active window

I'd like to be able to have excel scrape text from an active window
while I'm surfing. I can currently import a picture, but would prefer
the text.

I do a snapshot using the following code:

Public Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal
bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Public Const VK_SNAPSHOT = &H2C
Public Const KEYEVENTF_KEYUP = &H2


Sub screenshot()

For i = 1 To 10000
For j = 1 To 10000
Next
Next
keybd_event VK_SNAPSHOT, 1, 0, 0
Range("a5").Select
ActiveSheet.Paste

Application.ScreenUpdating = True

End Sub

The reason for the loop is to give me time to click on the desired
window after I start the macro.

My thinking is there is a possibility that

keybd_event VK_SNAPSHOT, 1, 0, 0

Could be changed to scrape the text instead of the snapshot.

I understand a website can be scraped, but prefer not to do it this
way. And I know I can hit control A, control C and control V in the
spreasheet, but prefer not to do it that way.

Thanks,

Geoffrey Pritchard Tillingsley
 
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
how to open a workbook per active window Jackie[_2_] Excel Discussion (Misc queries) 1 August 19th 08 11:13 PM
missing Active Window bar Gomer Fackworth New Users to Excel 4 May 28th 08 02:13 PM
How to Determine if Application Window Still Active Edwin Kelly Excel Discussion (Misc queries) 3 June 26th 07 05:42 PM
Active Window Question CWillis Excel Discussion (Misc queries) 4 July 19th 06 05:52 PM
Web scraping mickbarry Excel Worksheet Functions 2 February 1st 06 10:20 AM


All times are GMT +1. The time now is 10:19 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"