System.InvalidOperationException: Cannot serialize the DataTable. DataTable name is not set. at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result) at System.Activities.WorkflowApplication.IdleEventHandler.OnStage2Complete(IAsyncResult lastResult, WorkflowApplication instance, Boolean isStillSync) at System.Activities.WorkflowApplication.EventFrame(IAsyncResult result)
in a Write Range Workbook activity.
To troubleshoot this, I have set the datatable name before the activity using:
dtTable.TableName = “Table”
I have added a log message to verify that the name is indeed captured by UiPath.
Any ideas on how I can resolve this? I have tried UiPath.Excel.Activities package versions 2.16.4 and 2.20.3
I tried to recreate the error by creating a data table without a name but Write Range Workbook on my computer doesn’t have any issue with it. Whatever is causing the issue might not have anything to do with the table name.
In Object Cannot serialize the DataTable. DataTable name is not set ” Error even after setting datatable name
I’m seeing this error:
System.InvalidOperationException: Cannot serialize the DataTable. DataTable name is not set. at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Cannot serialize the DataTable. DataTable name is not set your data table do not have any Name.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Solution:dtTable.TableName = "Table" the you deseralized it
Use “Build Datatable” activity
And in Datatable name create a variable, which is then your datatable name.
Press Ctrl + K to auto create variable with correct type.