Insert Chart: Error HRESULT E_FAIL has been returned from a call to a COM component

It was normal when I created the pivot table, but when I got to the insert chart, I got an error.

The strange thing is that when I debug it found that it can generate charts.

Hi @1972134464
Welcome to UiPath

Add a short delay before inserting the chart to ensure Excel is fully loaded, and set "Visible" = True in โ€œUse Excel Fileโ€ or โ€œExcel Application Scopeโ€ to keep Excel active.

If you found helpful mark as a solution.
Thanks

It doesnโ€™t work

Hi @1972134464

As per Support docs:

UiPath Solution:

  1. Update UiPath.Excel.Activities to the latest version.
  2. Set Visible = True in Excel Application Scope.
  3. Use Kill Process activity to close any running Excel processes.
  4. Try using Invoke VBA to insert the chart.

Microsoft Solution:

  1. Update Excel via File > Account > Update Options.
  2. Repair Excel via Control Panel > Programs > Repair.
  3. Ensure Excel is not corrupted by opening it manually and saving as a new file.

It doesnโ€™t work. UiPath.Excel.Activities and Excel is the latest version


I fixed the issue, although I donโ€™t know why. The solution to the problem is to change the expressions of data range and insert into sheet to the same.