Copy Date Field from Excel

Hi Team,

I am trying to copy a “Date” field from one excel to another excel but the data is inconsistent after I complete copying data.

My Input :

image

Date Field Format :

image

Final Output File:

image

If you observe few dates are copied properly few dates are converted to string.
Please help me to resolve this

1 Like

Hey @Deeipauk

Please try making the output excel column type as text.

Thanks
#nK

Hi ,

Which method are you using to copy the date column,

  • if read range is used to read that column and write range to write into another excel I would suggest you to check the option “Preserve Format” during the read range

  • If invoke code is used then in pastespecial method use,
    Pastespecial (pasteallusingsourceformat)

  • if it is done manually then while pasting the range do a right click and there will be paste types select pasteallusingsourceformat

HAPPY AUTOMATION !!!

Hi @Deeipauk

Try this

Use Excel Scope for both reading and writing. Do not use Workbook activities.
For Reading → Excel Scope-> Read Range
For Writing → Excel Scope → Write Range

Have to use the Date.Parse(dateString, "dd/MM/yyyy", Nothing) also

Refer this post

I am using read range - when i select preseve format getting value like this
[$-148377769]d/m/yyyy

Hi @Deeipauk ,

You can try something like this

It will handle all type of date format and also you can get the string as you expected output