Microsoft Excel Automation in StudioX - Automation with charts

Hi, I have just begun my automation journey and hence I am unable to understand the following error which I get when I try to generate a chart from a different sheet than the one that I intend to create a chart in.

Error HRESULT E_FAIL has been returned from a call to a COM component. - What does this error mean and why does it arise?

To be more specific, I was trying to create a chart from the “annual_time_off” sheet instead of “Time off per employee sheet” as instructed in the course. Here’s the link: UiPath Academy

Thanks in advance!


Please check the below thread

Hope it helps!!


Welcome to the community

can you open more details and share the full details

Also generally on excel it might occur because of sheet being locked or the file being open before using

can you tell on which activity you are getting this error and the properties of those…One reason can be the specified sheet might not contain required data for your chart


Hi @Anil_G

Thanks! To be more clear, the sheet is not locked/protected or open on the automation run. I’m sure the sheet has the data for the chart, because as I had mentioned earlier, it was a learning tutorial which contains the base data for the chart.

The activity is the Insert chart activity and the properties are as in the attached image.


Hi @vrdabberu

I did take a look at this .NET installation, but I found that in the link, it was talking about a web application which threw this error, however, my issue is with respect to excel and the problem being the insert chart activity not generating the output on a different sheet, it works on the same sheet where the pivot table is but not when the source is the actual table itself.

Please do let me know if I missed something on the above thread which could solve my issue and I’ll definitely have another look.