I am trying to write to a sheet in an Excel. But I am getting this error : “Specified cast is not valid.”
There is no other details that there is to give. Can someone help me with this?
Please let me know if you need more information.
check what exactly you are trying to write?
Data should in Data table format and that variable type DataTable and it wont be empty.
It must be due to datatype mismatch between excel data and the Datatable data. You will have to either change the datatype of the Datatable columns to the same as excel data or opposite way. ChatGPT or Copilot can easily help you with invoke code you would require for this.
Check your data types match the excel columns, ensure proper type conversion, and that the file isn’t open elsewhere.
Happy Automation