After process completion excel Date & Time automatically changed

How to keep same format of Excel Automation…

When my task completed then check in Excel file and find the Excel Date & Time format automatically changed to General format.

  1. After Screen Completion Task

  2. Previous Screen Automation Task

Hi
we can concatenate the value of that column with a single quote using assign activity within a for each row loop like this
row(“columnname”) = “’”+row(“columnname”)
so that the format wont get changed
Cheers @ARahman

1 Like

@Palaniyappan, Can you tell me more detials… this is my existing workflow design

Hi @Palaniyappan,

I have faced this issue in one of my workflow,i have changed based on your inputs but am getting below error:
image

Anyone can suggest any better idea on this task?

Recently i faced this issues in my workflow. Anyone can suggest me how to manage this task without excel format changed.

Hi
Kindly have a view on this

Cheers @ARahman @RajeshT

1 Like

Hi @Palaniyappan @ClaytonM

Good Day!

I have an issue in same scenario which i am dealing with date and my date format is DD/MM/YYYY.
When i use the below code,
PolicyDate=row(“PolicyDate”).ToString.PadLeft(7,cchar(“0”))
Dates which are starting with Zero(0)
example:04/12/2019 becoming 12/4/2019(How can i handle in this scenario)
But dates which are starting with other than zero example:
example:14/12/2019 displaying correctly as 14/12/2019

Hey @RajeshT

Do a search on DateTime.ParseExact()
https://forum.uipath.com/search?q=datetime.parseexact

You don’t want to use .PadLeft() on strings which are dates; you want to go directly to a DateTime type from the string. The leading zeros are meaningless on the string, cause DateTimes can be seen with zeros or without based on your format needs.

A DateTime will be either as MM/dd or dd/MM based on your culture variant. If you use DateTime.ParseExact() then you can parse your string in the format “dd/MM/yyyy” which will give you a DateTime value, which you can format however you would like.

Example:

DateTime.ParseExact(row("PolicyDate").ToString.Trim,“dd/MM/yyyy”,CultureInfo.InvariantCulture).ToString("dd/MM/yyyy")

or leave off the .ToString() part on the very end if you want a DateTime type value instead of a string.

Regards

1 Like

My actual problem is not yet solve. Please suggest me if have any good way for same format information copy to another excel file. After write action date & time format changed automatically but i want to same format.

My existing output file with previous file…

My workflow

1 Like

Hi,

Anyone can share any process about this task. Actually I already try many process but not able to complete it.

Hi @ARahman ,

Have your tried with Invoke code ,refer below link