16. RPA Challenge - Create PieChart From Excel File


#1

I have an Excel File with Two Column and I want to Show That values in a PieChart ? But How ?


final_data.xlsx (9.0 KB)


How to create diagram
Excel and pie charts
#2

#3

@kirtiSagar
In quick shot, have you tried macro to create the Pie Chart? You can invoke the macro in UiPath to create the pie chart.

Regards,
Balram


#4

Hey,

Tried with a custom activity. Didn’t got much time to test all possible cases. But this should create a simple pie chart using the range from the excel file table.

CreateChartCustomActivities.1.0.1.nupkg.zip (7.6 KB)

Let me know if it works. :slight_smile:

Thanks,
Rammohan B.


#5

Using Invoke code

excel_pie.xaml (7.9 KB)


#6

When i run it , Its Show These Exception …
How To Solve It…
.


#7

It’s really helpful.

Thanks & Regards,
Shreekrishna K Devasya


#8

Are you running the same file? Based on the errors, looks like you have copied the code from Invoke code into new activity and forgot to create arguments. Please check “Edit Arguments” section.


#9

Hi Vinay,

I want to specify that you need Excel installed on the machine in order to be able to open the xaml.


#10

Correct. It uses Microsoft.Office.Interop.Excel to manipulate Excel and it doesn’t work without MS Office Installed.


#11

Hello @vvaidya, I tried your code and the .xaml successfully run,
but there is no effect on the Excel file (no chart seen .
Anything I am missing or there are some requirements on Excel etc? (currently using Excel 2010 here).


#14

Hi Kirti,
Following is a use case in which I have passed the hot key and created a normal graph. Same way you can try for pie chart or record other sequences for converting data to pie chart.
1.Send Hot Key Ctrl + a for selecting whole spreadsheet values
2.Send Hot Key Alt + F1 for creating a graph.

Using this basic graph will be created, you can modify the style of graph after that.


#15

Can u Upload Your .xaml File ?


#16

No Sir, I ll Update It As Per My Requirement but Same Error ?


#17

Same Here…


#18

Hi @kirtiSagar, I successfully ran the code eventually.
The code contains Try and Catch so if there is some error we don’t get notified by it, how about dropping the Try Catch to see if it throws any error?


#19

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

Steps

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)

Thx
~RPA Ninja


#20

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


#21

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.


#22

Done. Please check.