Excel append range gives UiPath.Excel.ExcelException: Could not write the data table DataTable starting with cell A1

Hi,

I tried to read one excel using the “Read Range” activity and want to insert the data table returned from that activity to another excel using “Append Range”. But it gives me ExcelException mentioned in the title. Below are the logs for the same, can someone suggest a solution on this?

RemoteException wrapping UiPath.Excel.ExcelException: Could not write the data table DataTable starting with cell A1. —> RemoteException wrapping System.Runtime.InteropServices.COMException: The message filter indicated that the application is busy. (Exception from HRESULT: 0x8001010A (RPC_E_SERVERCALL_RETRYLATER))
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at System.Dynamic.ComRuntimeHelpers.CheckThrowException(Int32 hresult, ExcepInfo& excepInfo, UInt32 argErr, String message)
at CallSite.Target(Closure , CallSite , ComObject , Int32 )
at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
at CallSite.Target(Closure , CallSite , Object , Int32 )
at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
at UiPath.Excel.WorkbookApplication.WriteDataTable(Range startRange, Int32 startRow, DataTable newTable, Boolean includeHeaders)
at UiPath.Excel.WorkbookApplication.WriteRange(String startCell, DataTable data, Boolean includeHeaders)
— 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)

1 Like

Hello,

I see the same issue, from time to time, using version 20.4. I believe I saw it also in 20.3.
It will be nice if there is a quick fix.

In my code, I put a step before write range to Kill process (Excel.exe) but no difference.

Vasile.

1 Like

@ajit_jadhav
Attached screenshot please to better assist you

Hi Sandeep13!

attach same issue.

i try with Range and create new pag.

@Exiamen
your excel is up to date? please update excel package and try once

Yes, use Excel package version 2.8.5

reason could be the excel application is busy.
you can kill excel Application first

Yes, I already tried it and it doesn’t work, also change to version 2.4.6 excel package

RemoteException wrapping UiPath.Excel.ExcelException: The range does not exist. —> RemoteException wrapping System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x800A03EC
at System.Dynamic.ComRuntimeHelpers.CheckThrowException(Int32 hresult, ExcepInfo& excepInfo, UInt32 argErr, String message)
at CallSite.Target(Closure , CallSite , ComObject , Object[,] )
at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
at CallSite.Target(Closure , CallSite , Object , Object[,] )
at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
at UiPath.Excel.WorkbookApplication.WriteDataTable(Range startRange, Int32 startRow, DataTable newTable, Boolean includeHeaders)
at UiPath.Excel.WorkbookApplication.WriteRange(String startCell, DataTable data, Boolean includeHeaders)
— 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)

Hi there,

I have faced the same issue however using the try catch activity for write range it will write the data-table in excel work book.

Assumption: Due to faster execution of this activity(Write Range) excel work book is closing automatically without timeout that leads to throw an error.

Note: Use Try Catch inside write range activity, in catch use Uipath.Excel.ExcelException

Let me know if this helps