Macro to automatically convert prt scr image-based text to real text in cell

jasonfromchico

New member
Joined
Mar 21, 2014
Messages
4
Reaction score
0
Points
0
I need help programming my Excel VBA Macro to do OCR (text recognition) from a prt scr screen capture image and input the text into cells. Currently my Excel file has a push-button, and upon clicking on it the macro pastes into Excel the current clipboard image I have created by pressing prt scr while in another program. The macro then crops the image to the region with the applicable text. I have to then manually type the text I see in image format into the appropriate cells.

Can someone help me with the VBA coding to automate this? I’d like it to use the clipboard image and run it through OneNote OCR, after which the applicable text values are automatically entered into the cells. Ideally the code will first crop to the region with the desired text before it does OCR. If this is not feasible, it will need to incorporate a method (keyword search?) to hone in on the desired text after the entire prt scr image has been OCRed.

Thank you.
 

patel

New member
Joined
Feb 20, 2014
Messages
60
Reaction score
0
Points
0
Location
Italy
Excel Version(s)
2010
You can not automate this process with vba
 

p45cal

Super Moderator
Staff member
Joined
Dec 16, 2012
Messages
2,200
Reaction score
16
Points
38
Excel Version(s)
365
I suspect that you just might be able to do this. Even if you don't have a version of Office which includes OneNote, MS have just made it available for free:
http://www.pcworld.com/article/2108...c-and-windows-adds-new-note-taking-tools.html
http://www.zdnet.com/microsoft-delivers-free-onenote-for-mac-and-windows-7000027378/

I've never used OneNote before and I discovered that it was already installed on my desktop.
I'll have an explore when I get the time, in the meantime:
http://msdn.microsoft.com/en-us/library/hh377183(v=office.14).aspx

Could you perhaps post some of your existing Excel code that manipulates the clipboard image - just to get me started?
 

jasonfromchico

New member
Joined
Mar 21, 2014
Messages
4
Reaction score
0
Points
0
Awesome. I want to use OneNote because it is now the MS standard for OCR, but I'm open to using MODI instead if necessary. My code basically pastes into Excel the clipboard image of the prt scr I made from an active window of a different program. Then it crops the pasted image down to the region with the numbers I need. Then I manually type these numbers into cells. I'd like to have the code run the prt scr image through OCR and somehow isolate these numbers, then have them be pasted directly into the cells. CODE:


Sub View1Paste()
'
' View1Paste Macro
' Macro recorded 6/8/2011 by xxx.
''
Range("B3").Select
ActiveSheet.Paste
Selection.ShapeRange.PictureFormat.CropLeft = 542.93
Selection.ShapeRange.PictureFormat.CropRight = 33#
Selection.ShapeRange.PictureFormat.CropBottom = 38.25
Selection.ShapeRange.PictureFormat.CropTop = 520.43
Selection.ShapeRange.IncrementLeft -549.75
Selection.ShapeRange.IncrementTop -108
Range("F33").Select
End Sub



I suspect that you just might be able to do this. Even if you don't have a version of Office which includes OneNote, MS have just made it available for free:

I've never used OneNote before and I discovered that it was already installed on my desktop.
I'll have an explore when I get the time, in the meantime:

Could you perhaps post some of your existing Excel code that manipulates the clipboard image - just to get me started?
 

p45cal

Super Moderator
Staff member
Joined
Dec 16, 2012
Messages
2,200
Reaction score
16
Points
38
Excel Version(s)
365
I'm still researching this one when I get the time - but I'm not getting a lot of that time! Anyway, could you fill me in on your setup; versions of windows, Excel, is MODI available on your system (it ccould be the path of least resistance)? Is it for use by you only on your machine or are you looking at setting the functionality up on other people's machines etc. etc.
And another thing, you mention the active window of another programme; is this screen really only an image? What is the programme/application? There may be more robust ways to achieve the same end.
 

p45cal

Super Moderator
Staff member
Joined
Dec 16, 2012
Messages
2,200
Reaction score
16
Points
38
Excel Version(s)
365
Lost interest?

Anyway, could you fill me in on your setup; versions of windows, Excel, is MODI available on your system (it ccould be the path of least resistance)? Is it for use by you only on your machine or are you looking at setting the functionality up on other people's machines etc. etc.
And another thing, you mention the active window of another programme; is this screen really only an image? What is the programme/application? There may be more robust ways to achieve the same end.
 
Top