Write DataTable to Excel Error

I have a joined dataTable i got from joinning excel sheets
i was trying to write datatable to excel and i keep getting this error :slight_smile: Main.xaml: (2): error BC30652: A reference to assembly ‘System.Xml.ReaderWriter, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ containing type ‘IXmlSerializable’ is required. Add one to your project.

i dont know where does the problem comes exactly

Hello @kawtar.ettayarssouti

can you capture screenshot at dependencies? on project panel

Best Regard,

Here is it
Thank you

Hi @kawtar.ettayarssouti

When you are writing the Data table you have passed “Results” in destination & I can clearly see that in Result is of type Data Table. So, instead of Giving the Data Table variable i.e. “Results” give there the file Path where you want to write the Joined Data.

Hope this works,
Best Regards.

Hi @kawtar.ettayarssouti ,

The Default value should be removed from Variables Panel for the Results variable… I do not think it is a Proper value added. Instead just add the below :

new System.Data.Datatable

Maybe for your case, you would require to use the Workbook Write Range activity instead of the Modern activity.

I think variable Result is fill in wrong type in destination at write datatable to excel activity
in destination slot it has to write in this kind of format

Also if you use write datatable to excel(Modern) you have to put it inside “Use excel file” Activity just like picture above

Best Regard,

i will try this and see if it works
thank you

i tried this solution and it works
thank you for your help

1 Like

I’m glad to hear this and you’re welcome

have fun automation :smiley:

1 Like