Assign: Conversion from string "29-04-2022" to type 'Date' is not valid

The bot doesnt recognize the date time, i use this assign because when it write it in excel it write it with US format and not FR format

image

image

Hey!

Try this:

Assign strDate = Datetime.ParseExact(Strinput.ToString, “MM-dd-yyyy”, System.Globalization.CultureInfo.InvariantCulture).ToString(“dd/MM/yyyy”)

First format is your excel orIginal format
and the last format is your required format

Regards,
NaNi

the first format is good
image

but when it write it on excel it changes to US format and i don’t know why

Hey!

Create one temp data table…

Push this data to temp data table then write back to excel…

Try in this way…

Regards,
NaNi

how can i do that ?

Try this:

Take one Build data table - Create the columns which available in the excel - Output as - Dt_Temp

1.Read the excel using read range-Output as ->Dtout
2.Take one For each row in data table activity pass the->Dtout
3.Take one add data row activity

ArrayOfRow:

{CurrentRow(0).ToString,strDate,CurrentRow(2).ToString........}

Note:
The column positions must match with the ArrayofRow

Regards,
NaNi

DateTime.ParseExact(strIn, “inputformat ex : dd/mm/yyyy”,System.Globalization.CultureInfo.InvariantCulture)

try this var type should datetime