Extracting Chart/Images from Excel

Hi,
I am trying to save charts as images from an excel file. The current plan I was attempting was to save the excel as a web page which will generate a folder of resources where the charts will be included as an image and then get the chart from there. However, when I try to save the excel file as a webpage, the select item activity doesn’t actually activate the file type. The below image shows the “Web Page” type selected but the save as dialog is not registering this. Choosing to save like this will cause the file type to still be an excel.


The below image shows how it should look like if Web Page type is actually selected

Is there a solution for this? Or is there a better way to extract the charts from excel instead of saving it as a web page. Thanks.

@p3tr1fy

ExcelExtractChart.zip (18.9 KB)

  • in the Excel File, add the Macro to save the Chart to Image (image save as D:\mychart.png in the workflow) then assign keyboard shortcut for the Macro (CTRL-SHIFT-A)

  • at UiPath Studio use Click activity at the Excel Chart (to select the Chart) and activate the Macro (send HotKey) and process the image.

Save Excel Chart As Image macro tutorial:

Thanks. But my concern is how will UiPath reliably select a chart. For example, if UiPath is on another sheet or if the chart itself is not in view.

In the workflow, it first open Excel Application and continue with a click to the Chart.
This will make the Excel apllication in focus and the Chart selected.

The reason your workflow works is because the chart is large enough and also within range of the click activity. If for example you were on sheet 2 of your excel, the bot will click nothing and fail the execution of macro.

1 Like

I have found another solution which is to use the select range activity for the chart and send hot key (ctrl + c) to excel and then paste into paint to save as image. This way it reduces the need for macro as I do not want to save the excel as macro enabled to be part of the automation process.

1 Like

Hi @p3tr1fy ,

Here is an activity is called “Extract Graph image” from BalaRevaEasyExcel .It extracts all the images from the sheet.

Regards
Balamurugan.S

1 Like

Hi @hermawan,

How can i copy or cut graphs from excel and paste in new sheet

Regards,
Balasubramanian

1 Like

Hi @BALASUBRAMANIAN,

You can use the above activity to get all the chart as image.

You can use the insert picture activity from below.

Regards
Balamurugan.S

Hi @balupad14,

I want as graph, not a image

Regards,
Balasubramanian