Copy only header value to excel

I need to extract datatable header and copy the header part alone to Excel sheet .
I tried with DataTable.Clone but when i tried to write the cloned datatable using write Range activity …i cant find the header in the sheet.


It’s difficult to tell exactly what your issue is without seeing your workflow (please share it or include screenshots when asking questions)

First thing I’d check is make sure that when you Write Range that the AddHeaders property is checked:

If add headers is not checked, the headers of the DataTable won’t be written to the Excel file.

Alternatively, if you just want to extract the headers you can do so in a For Each:
Making sure to change the TypeArgument in the For Each to System.Data.DataColumn:
In the body of the For Each you can then add the columns to an Array or List or some collection that you can then use to write into the Excel.

If I’ve misunderstood your question or not solved it, please provide some more details about your issue.