I have an Excel file in which the first sheet of the Excel file is Chart Sheet. This special sheet does not contain rows, columns, or cells, just a chart, like this:
After many attempts to understand why this happens, I have discovered that if the first sheet of the Excel file is a Chart Sheet (with no columns, no rows, no cells) UIPath gives the error.
If I change the file, and move the Chart Sheet to be second in order, then UIPath can execute the “Get Table Range” activity with no errors. So the problem here is when the first sheet is a special chart.
Does everybody has the same error behaviour?
(I am wondering if this is an issue of UIPath or my old Excel 2007).
If so, is it possible to change the order of the sheets in the Excel file?
I am attaching the Workflow and Excel file for you to simulate it. ChartExcel.zip (15.1 KB)
Actually you are getting this error because your cast is wrong because you are using “Excel Activity Scope” with it.
Namespace: Microsoft.Office.Interop.Excel Assembly: Microsoft.Office.Interop.Excel (in microsoft.office.interop.excel.dll)
This interface only gives you worksheets - not charts.
Go to Remark section
On the other hand, if you will use “Workbook Activities” so it’s instance _Workbook.Sheets gives you a Sheets instance.
Go to Remark section
The interfaces are not assignable to each other; therefore, you are getting the COM error.
i have not yet tried so do not know it’s possible to get an instance of the Worksheets interface through the “Office Primary Interop Assemblies”.
As long as you will use workbook activities i.e. _Workbook.Worksheets property instead of the _Workbook.Sheets property, you should get an instance of Sheets that only returns Worksheet objects for these charts objects etc. as i explained above.
Here this post is just for your update that now You will be able to use Excel file having chart as a sheet with Excel application scope and All Excel Related Activities..
I have tested it and it is working as per expectation
Here are the Information about The Excel Activities package version in which this issue has been Fixed
Hope this information will be useful for other users
Package Version - 2.0.6479.13204
Published on - 10/08/2017
Issues has been Fixed with Excel Related, are as follows:slight_smile:
1. Fix Excel Application activities failing if the workbook contained Charts
2. Fix Workbook Get Table Range for Pivot tables throwing exception
3. Fix Workbook Read Range 'too many parameters' error
4. Fix Workbook Read Range 'Expression expected' error
5. Add Headers option for Read Range is set to true by default