Anyone has any code example(s) for Get and Transform Data from picture

Monty Norman

New Member
Joined
Mar 12, 2023
Messages
23
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
  3. Mobile
Hello All,

I tried to record a macro to see what the code looks like to "import" data from images and it only recorded some range selection, and Column AutoFits.

I have about 3000 images, mostly .JPG and I get 300 per day, of screen shots of process data, so code is the best way to get this data into a worksheet.

Thanks in advance.

Monty
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Hi. Unfortunately, Microsoft has not exposed this functionality to VBA, and so you would need to find some other way of getting the data from the images. There are many online OCR services (some with free tiers) - Microsoft, Google, Amazon all have this kind of service. Alternatively, if you're not able to send the files for processing in the cloud, you could try desktop solutions - there are plenty of open source options like Tesseract, etc.
 
Upvote 0
Hi. Unfortunately, Microsoft has not exposed this functionality to VBA, and so you would need to find some other way of getting the data from the images. There are many online OCR services (some with free tiers) - Microsoft, Google, Amazon all have this kind of service. Alternatively, if you're not able to send the files for processing in the cloud, you could try desktop solutions - there are plenty of open source options like Tesseract, etc.
Thanks @Dan_W I know this is a new feature, and I am doubly hoping that MS soon will give us some VBA code to be able to do this.

For now, its one image at a time!
 
Upvote 0
Thanks @Dan_W I know this is a new feature, and I am doubly hoping that MS soon will give us some VBA code to be able to do this.

For now, its one image at a time!
:)

Microsoft stopped adding VBA access to its new features a while back. There are still hacky ways of executing those features in VBA, and I've managed to kinda do it here too, but it's unreliable. I can only get it to open the pane - it is then very challenging to 'click' the button to process the image. Because it engages the clipboard too, the whole thing is unreliable.

If you are able to install things on the computer, you might want to look at AutoHotKey. There are a few OCR solutions available there, but it all depends on the quality of your picture.

Actually, there is one more solution that produces impressive results - you may have heard of a Microsoft program called PowerToys. Basically, it's a collection of tools - like colour picker, etc. There is a new tool there that extracts text from a designated part of the screen (basically, an image) - PowerToys Text Extractor utility for Windows . I've looked at the code for this tool, and it appears to use functionality built into Windows 10 (and doubtless, 11) - I suspect the Excel Get Data from Picture uses this same OCR engine, but I might be wrong. In any event, I find the tools ability to extract text to be very good, but I haven't worked out how to access it from VBA yet.
 
Upvote 0
Sorry, I might have misunderstood - I thought that this is what OP was referring to, but wanted to know how to engage this function programmatically with VBA given the volume of images that needed to be processed. If I misunderstood, apologies for my various musings/ramblings above! :confused:
 
Upvote 0

Forum statistics

Threads
1,214,789
Messages
6,121,590
Members
449,039
Latest member
Arbind kumar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top