I want to extract image from Excel

Hi All,

I want extract image from excel and the sheets and files are dynamic.

Once extracted the image, than need to get text from that picture.
How can I achieve this.

@Yoichi

Thank you!!

@vineelag

  1. Excel Application Scope:
  • Path: your_excel_file.xlsx
  1. Invoke VBA Code:
  • Use the Execute Macro activity to run the ExportImages macro.
  1. For Each Image in Folder:
  • TypeArgument: String
  • FolderPath: "C:\Path\To\Save\Images\"Inside the For Each activity:
  • Load Image:
    • FileName: item (current image path from the loop)
  • Tesseract OCR:
    • Input: Image (from the Load Image activity)
    • Output: ExtractedText
  • Log Message:
    • Message: ExtractedText

thank you! @Krishna_Raj

can you share with me excel macro code,
where,

  1. I want to extract the image from different files
  2. sheet name is dynamic
  3. image position(cell) is also dynamic sheet to sheet
  4. In a sheet it may be have one or more than one image and I need to extract all the images.
  5. How to pass variables to this VBA code.

Please kindly let me know the code and how to pass the values in VBA!

Thank you!!!

Hi,

Can you give us a sample xlsx file? It’s no problem if dummy data.

Regards,

1 Like

Hi there

Just to sidetrack a bit, how did the image get into Excel? Would it be possible to obtain the image directly from the source? Getting it from the source would simplify the process for you, eliminating the need to search through Excel sheets to find the image.

Can you please let me know @Yoichi is it possible or not

Try attached workflow.

XlsSaveImages.xaml (20.2 KB)

Cheers

1 Like

Hi @J0ska,

Thank you!!

I really Appreciate!

will you please guide me how to use this exactly xaml for above input files.

once again thank you @J0ska

1/ Open excel using “Excel Application Scope” activity (it is “Classic” activity)
2/ Use output propperty “Workbook” as input argument of WF I sent you
That’s all.

Cheers

1 Like

That’s a job for you.
Cheers

Hi @J0ska

After Running this code also I am not able to see any image saved in the given path.

Thank you!

You can read below articles

Hi @mukesh.singh

I Already seen that solution it doesn’t work for me, because excel sheets where images are placed dynamical.
you can see them given files at above.

Thank you!

Hi,

Excel using Excel Application scope and using the Excel Activity to Read
Using OCR activity to extract image
used extract text using Excel Activity

Attached is an updated workflow.

  • fixed interpretation of “strSaveTo” argument
  • added filtering of shapes

XlsSaveImages.xaml (22.5 KB)

1 Like

Hi @J0ska

After Downloading the images and clicking Close work book gritting this popup for every sheet

image

thank you!!!

When I tested with your files I openned them read-only and I did not get such popups
image

Cheers

Hay @J0ska

Those are test Files

I did the same,

image

But getting this pop up after downloaded the images

Actual logic using in this way

Hay @J0ska

Instead of using Classic Activities Can I use Modern Excel Activities, is it Possible.

if so In workbook what i need to replace ?

I did not use modern excel activities so far. But I guess it is using different technique to handle excel actions and there is not workbook object available → my workflow won’t work.

What about switching off “Visible” option? Would it prevent the popup?
image