Read Range Exception : Invoke set ordinal

Hi community,

I have used a invoke method activity with set ordinal method to reorder columns. Then for the same sheet if i run the process second time to reorder some other columns, its showing could not read range error. If i run the same workflow for another sheet, it works fine.

why is it not allowing to reorder columns for second time in the same sheet?

Source: Read Range

Message: Could not read range .

Exception Type: UiPath.Excel.ExcelException

UiPath.Excel.ExcelException: Could not read range . —> System.Runtime.InteropServices.COMException: Out of present range. (0x8002000A (DISP_E_OVERFLOW)) at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object providedArgs, ParameterModifier modifiers, CultureInfo culture, String namedParams)
at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Object aArgs, Boolean aArgsIsByRef, Int32 aArgsWrapperTypes, Type aArgsTypes, Type retType)
at Microsoft.Office.Interop.Excel.Range.get_Value(Object RangeValueDataType)
at UiPath.Excel.Helpers.AreaHelper.ExtractRangeTo2DArray[T](Range range, Boolean preserveFormat)
at UiPath.Excel.WorkbookApplication.ReadRange(String address, Boolean preserveFormat, Boolean& isWholeRange)
— End of inner exception stack trace —
at UiPath.Excel.Activities.ExcelInteropActivity`1.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

Thanks

Hello @GaneshPalaniappan

  1. Check that your Excel range is correctly set.
  2. Ensure each column reordering operation resets the Excel range.
  3. Use proper error handling.
  4. Consider using UiPath’s Excel Workbook activities for column reordering.

Thanks & Cheers!!!

Hi Kartheek,

Excel range is specified as “”
Excel workbook activities used.

Could you pls explain the second point? How to make it reset