Exporting datatable to CSV

I’m on 2021.10 version. When I try to export a datatable to CVS I get an error that it disallows implicit conversions from ‘System.Data.DataTable’ to ‘UiPath.Excel.IReadRangeRef’. I’ve never heard of that type of object but when I ctrl-k to add the variable in the Write From box that’s how it sets up the variable. How do I convert my datatable to that type of variable?

Hi,

Can you try as the following at DataTable property?

img20220203-1

Excel.Sheet("Sheet1").Range("A1:D6")

or

Excel.Sheet("Sheet1")

The property name isn’t good, i think.

Regards,

So I’m reading a PDF, filtered my data into a datatable and want to write that datatable to the CSV. What changed so that we can’t write tables to CSVs and what is a IReadRangeRef variable type and how do I convert my table to write to it?

Hi,

In this case, we can use WriteCSV activity. Can you try this?

https://docs.uipath.com/activities/docs/write-csv-file

Regards,

2 Likes

That did what I needed it to do. Thank you!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.