16. RPA Challenge - Create PieChart From Excel File

Hi Guys, Maybe I am late in replying, however, I find the solution to the problem rather simple.


1. Drop activity Excel Application scope  (Choose your file)
2. Select the range of data
3. Click activity on "Insert" tab (remove unnecessary auto-generated selectors)
4. Click on pie chart drop down (remove unnecessary auto-generated selectors)
5. click on 2-D pie (remove unnecessary auto-generated selectors)
6. Send hotkey Ctrl+s

Voila, the chart is there. This shall work with Excel 2017.

Now see another simpler way

1. Drop activity Excel Application scope  (Choose your file)
2. Select the range of data
3. Send hotkey combination: Alt + N + Q + enter
4. Send hotkey combination: Ctrl + s

In RPA sometime solution of a problem is not in programming always try to mimic user first then start thinking about inserting code.

PS: Now the solution has been uploaded, please change path of the file, as per your system.
MakeChart.xaml (14.9 KB)

~RPA Ninja


Hi Rpatech.
Please use the above excel file(final_data.xlsx) and upload the .xaml file here. Thank you .

Hi Kirti,
I am not able to upload the solution. Getting error “New user can not upload attachment”. I have solution for Normal bar graph and Pie chart both.

Done. Please check.

Where ?

Hi Avanish,
Please Share Your .Xmal File ?

It is now in my earlier answer. Uploading again here.MakeChart.xaml (14.9 KB)

~RPA Ninja

1 Like

Can U Please Upload Code For Barchart ?

hi @kirtiSagar

In the same code you can use send hot key as Alt+N+B+enter

Ashwin S

Want VB Code For This ?

hi @kirtiSagar

Use the below code and mention the range
Sub BarchartMethod()

Dim rng As Range
Dim cht As Object

'Your data range for the chart
Set rng = ActiveSheet.Range(“A24:M27”)

'Create a chart
Set cht = ActiveSheet.Shapes.AddChart2

'Give chart some data
cht.Chart.SetSourceData Source:=rng

'Determine the chart type
cht.Chart.ChartType = xlXYScatterLines

End Sub
Ashwin S

1 Like

Hi Folks,

I used simply sequence.
I wish to write one day a proces with invoked code. @vvaidya this is cool!

16. RPA Challenge.zip (493.4 KB)

Hi Rammohan,

I am trying to test your activity and I get the error below:

What am I doing wrong? It seems to be a problem with Excel. I have Office 2016 installed. Do you think it has something to do with Office version?


Hi Avanish,

Can you please try to upload now?

Hi Kirti and Ovi,
Please find the solution and let me know for any difficulty in it.
test_Graph.xaml (17.7 KB)
Book1.xlsx (8.5 KB)
final_data.xlsx (9.0 KB)

1 Like

Hi @kirtiSagar,
sorry for this late response, but as they say, better late than never :wink: Here is a simple solution in three activitiesPie Chart.xaml (7 KB)

  1. selecting the range,
  2. selecting a pie chart to be created,
  3. saving the file.

Hi @ovi and @badita

I have create a custom activity to generate the Pie chart for the excel file data.

I would be happy to get more suggestions .


1 Like

Hi @kirtiSagar

I have developed a package for your challenge that I have attached it above with your example. Is this solution that you expected…


Bump :slight_smile: :smile: