Bot not writing my output to my Excel file

My bot is currently pulling a file based on the date and manipulating 1 column. I have it successfully doing that, however I am not able to get the final output written on a excel sheet. Can someone please assist, attached is a copy of my current code.

@bagayoko.isaac.b I don’t think you’re updating the Datatable, you would have to use Assign Activity at the end of the For Loop in this way :

row(“Termination Date”) = TerminateDate

Also use the Write Range after the For Each Row not inside the For Each Row

What do I put in the Write Range because the Data Table is not being updated so when I write the Data Table to the Write Range it’s just writing the same data that was originally read from the worksheet.

@bagayoko.isaac.b Why do you have F3:F5 as the range ? If TerminateDate is the value that you want to update to the column in Datatable, them it is the right method. But It light not be uodating all the values since you have specified only specific range. If you want all the values to updated you would need to keep the range value as empty

Its not updating any of the values. It’s not working at all. I have a small range because I only have 2 rows + a header in this worksheet. Simply for testing purposes before I do it on the larger worksheet.

@bagayoko.isaac.b Can you provide that sample excel sheet, and tell us what is update operation you are trying to do. we can try to do the same and check

Okay. The sample data is attached. I am trying update column F (Termination Date) to display just the date in this format (7/30/2020).
DOL_Separations_Report_20200730.xlsx (212.3 KB)

If you run in debug mode and break just before writing the range is there anything in your data table? What is in your assign activity DateTime.FromOADate(row(“Termination Date”).ToString(“M/dd/yyyy”)?

@bagayoko.isaac.b Check this Workflow :
I was able to convert to the value needed. But it’s only for representation purpose. Since the type of that Column is Date, it might always have in both Date and Time format. But If you check the Excel file and Execute the workflow. You will notice the format did change, but I think there is some inconsistency because of the Column Type.
Read (72.3 KB)


Build a new data table with you required fields for final output. Once you have done with your manipulation in excel successfully read the excel data and add it in New data table.
Finall use the ‘writerange workbook’ and write in excel

I hope it works. Let me know if any issues.

Mark as solution if it works

Do you happen to have the code for that? I was trying to do this but it did not work.

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