I am facing an error while trying to read an excel report downloaded from SAP having 71 Columns using Workbook Read Range.
Source: Read Range
Error Message: Row number must be between 1 and 1048576
Exception Type: System.IndexOutOfRangeException
An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
System.IndexOutOfRangeException: Row number must be between 1 and 1048576
at ClosedXML.Excel.XLWorksheet.Row(Int32 row, Boolean pingCells) in C:\Projects\ClosedXML\ClosedXML\Excel\XLWorksheet.cs:line 1368
at ClosedXML.Excel.XLWorkbook.LoadRows(Stylesheet s, NumberingFormats numberingFormats, Fills fills, Borders borders, Fonts fonts, XLWorksheet ws, SharedStringItem sharedStrings, Dictionary2 sharedFormulasR1C1, Dictionary2 styleList, Row row) in C:\Projects\ClosedXML\ClosedXML\Excel\XLWorkbook_Load.cs:line 1329
at ClosedXML.Excel.XLWorkbook.LoadSpreadsheetDocument(SpreadsheetDocument dSpreadsheet) in C:\Projects\ClosedXML\ClosedXML\Excel\XLWorkbook_Load.cs:line 227
at ClosedXML.Excel.XLWorkbook.LoadSheets(String fileName) in C:\Projects\ClosedXML\ClosedXML\Excel\XLWorkbook_Load.cs:line 45
at UiPath.Excel.WorkbookFile…ctor(String workbookPath, String password, Boolean createNew)
at UiPath.Excel.Activities.WorkbookActivity1.ConstructWorkbook(String path, String password, Boolean createNew) at UiPath.Excel.Activities.WorkbookActivity1.BeginExecute(AsyncCodeActivityContext context, AsyncCallback callback, Object state)
at System.Activities.AsyncCodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.ActivityInstance.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
![ReadRangeError|690x245]![ReadRangeError|690x245]
Hi
Welcome to uipath community
Fine
Kindly uninstall the EXCEL package in the Design Tab → Manage Packages → Project dependencies ->uninstall the excel package and again reinstall by going to Official tab → search for Excel.Activities and install it
–use a read range activity and mention the range as “” no space in between and the sheetname and workbook path same as how its mentioned now
Kindly try this and let know for any queries or clarfication
Cheers @praveen_satya
I can read the same file with Excel Application Scope Read range but problem here is when i run in VDI, bot is in reading mode for hours (Ex: 10 hrs) and It is not even throwing any error after 10 hrs.
So that’s why i want to read data using Workbook Read Range.
I have even tried to read excel file as database. I could able to get datatable but that is returning me null values.
I found a solution by copying the data from downloaded Report to a new Workbook using VB script and then Reading that new Workbook file. It is working like that.
May be Data got corrupted when it got downloaded from SAP.
Hello @praveen_satya , could you help me by explaining how to use the vb script or more specifically how the code would be for this to work, I am having this same problem when downloading excel files from SAP