Delete range in excel file (issue with date format)

Hi everyone,

That’s my issue with excel file :

My bot add row in an excel file and after the bot check on the datatable if there is an “OK” on status column, if there is an “OK” the bot take the row > Add to a collection > and for each row in the collection the bot remove the row in the data table.

I have dates in my excel. When i delete all the range in my excel file to write the new datatable (without the line which have an “OK” on the status), the format of the date change (French to US). How i can keep the good format.

Maybe there is a solution without delete all the range and just remove directly on the excel file ???

If anyone have a solution, please help me :slight_smile:

Thank all !

@BCdev

If i understood you correctly, you need to convert the datetime varaiable and filter datatable

You can use Filter Datatable for deleting the range and assign new datatable

You can refer below post
Tutorial : Another way to check the string is present in Excel or Not

Hope these may helps you

Thanks

It can be very helpful for me !

Just a question if you have already used this activity. The bot will remove all the row right ?

And, can we add a variable or argument in “Value” on the actiivty ?

Thx for your help !

@BCdev

For adding the value you have to use assign activity

You can use both keep and delete options

Check below post for your reference

In the above one I am using

DT.Rows(IndexofRow).Item(ColoumnName) = Your Value

I think i will have the same issue. I will test it. Maybe i was not clear.

I have a data table with columns which contain date, and a column with contain a status (OK or KO). When the bot found a OK in the status column, the bot remove the row on the data table.

For write the new data table in my excel, i need to delete all the range in my excel, and when i write the new one in the excel, the format of the date have changed ( 02/04/2020 for dd/MM/yyyy to 04/02/2020) I don’t know why.

@Srini84

Thanks for your help but i found the solution on my side :slight_smile:

I use Write Range workbook and nothing change ! If a person encounter this issue where formats for date or something like that change, need to use Write range for Workbook and not for Excel.

1 Like

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