Copying Integer to another Excel cell generates different value

datatable
excel

#1

Hi, I have a datatable with a column that contains 22-digit data. When I copy it to another cell, it’s not the same.

  input cell value: 0123456789012345678901
output cell value: 1.23457E+20 (123456789012345000000) 

I somehow know that it is probably because MSExcel cannot display numbers with more than 15 digits,
but do you know how to possibly copy this kind of data to another row/sheet of excel using UIPath?


#2

Hi, i have tried the value while copying and pasting into excel manually. Its still converting the value as you mentioned but if you will try pasting value as TEXT in excel the value will not change and will remain as it is.

Main.xaml (5.8 KB)
TestData.xlsx (8.5 KB)


#3

Hi Rashmi!

Thank you so much for this.
I tried your xaml with TestData.xlsx and it is indeed working properly.

So I investigate why it is not working on my file.
It seems that if my cell previously has a formula in it, value.ToString does not work.
I am trying to check now if I can set the cell format to String/character before Write Cell/Write Range

I will greatly appreciate if you have other recommendations.
Thank you!


#4

Add single quote at beginning of your string value '0123456789 it force excel to not try convert it to the numerical