16. RPA Challenge - Create PieChart From Excel File

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)


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:

1 Like

Very simple:
Go to excel workbook and do the following:

  1. Open a blank workbook in Excel .
  2. Go to File > Options > Trust Center.
  3. Click on Trust Center Settings…
  4. Under Macro Settings, make sure Trust access to the VBA project object model is checked.

Download the following zip : Easyupload.io - Upload files for free and transfer big files easily. ( new users can not upload files therefore I uploaded this file for you ) .

Place excel file and vba script under : C\Excel
Create new sequence as you see in picture attached ( inside the zip)

Click play and N-Joy

Don’t need any new packages .
@admins please mark this challenge as completed :slight_smile:

@badita please mark this discussion as completed :slight_smile:

Dear KirtiRanjan Sahoo,

The easiest way to create a pie chart from Excel data is given below:


  1. Enable Trust access to the VBA project object model

  2. In your Main Workflow, invoke VBA code for making a Pie Chart.

  1. VBA code for generating a simple Pie Chart is given


For reference, please find the workflow as attached.

PieChartFromExcel.zip (33.5 KB)


Excellent Statement! I’ve been almost trying to explain this to others around me about the difference between RPA and traditional coding and automation.