String converting to DateTime

I am reading sequence number as a string from excel (1MAY3323). When i write this same string into other excel sheet it is converting to DateFormat (1-may-23) any suggestions to avoid this.

Thanks

@sathwik19

I guess the column type is Date in the other excel file. Could you please change it to Text and then try once.

that’s because excel date is setup that way. You have two options change the date format in excel or change the format of the cell to text

Hi
Hope these steps would help you resolve this
—use excel application scope and pass the file path of the first excel file
—inside the scope use READ RANGE activity and get the output with a variable of type datatable named dt
—now use FOR EACH ROW activity and pass the variable dt as input
—inside the loop use a assign activity like this
row(“yourcolumnname”) = “‘“ + row(“yourcolumnname”).ToString

That’s is concatenate with single quote before the string so that the column will be set automatically to text format

And now use WRITE RANGE activity and pass the variable dt as input and enable add headers property while writing in another excel file with EXCEL APPLICATION SCOPE

cheers @sathwik19

Here is a detailed article on that :slight_smile:

1 Like

Thanks @Palaniyappan It Worked

2 Likes

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