How to write data so Excel can recognize it?

Hello there! First post here.

I’ve used Table Extraction from a website to get some raw data, it automatically saves the data into a new DataTable variable. Then, I use write range to save into an excel file. Everything is fine until I open the file. I get something like this:

I would like to somehow format the data so that Excel can automatically read as some numeric type, and not as String. For some columns I know I have to change DataType columns as Integer or Double, when there is only the number on the cell. But I would like to represent, for example, the “$” values as cash in Excel, and not as text (General format), but I don’t find the way to do it in UiPath, and I really like to avoid UiAutomation.
Same for cells with “%”, M, K (at the end of the number and add the correct amount of 0’s).

Thanks in advance! <3


Can you please try below weblink? that is telling to do automation

After you write datatable into excel, then read it and use for each to iterate over datatable and convert columns you want,
For each row in datatable{
// Take write cell activity to replace existing text in cell
Cint(row(“column_Name”).ToString) // convert string to integer
like this you can also do

I checked the link, but still the same problem. I wanted not to just change to int, but also remove those green things in every cell when I open the file. That means that Excel treats these “numbers” as text, but for % values I couldn’t just convert to int, because of %, but for excel it is a number, Idk if i’m explaining myself.

The solution I’ve found was to use an Excel Aplication Scope, and then for there use write range activity inside the scope, and not to use the Write Range activity that doesn’t use Excel Aplication Scope.
Basically, when using Excel Aplicaction Scope, it opens the app and when all the values are writed, because of excel is open, excel automatically gives the correct format for every value, so %values are not strings anymore but treated as numbers with percentage format (like if you were writing a 32%, and it doesn’t appear as string).
I got confused a lot because there are 2 activities that are called the same but have different functions, I mean Write Range, but one of them uses excel scope, that was my solution and I am greatful.
Thanks in advance for your answer:)

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