Write number format in excel instead of Generic

Hi All,
I am working on one of the process to automate. I need to write filtered output to new excel file.
However, when I try to write to new excel file, the output of one of the columns needs to be in number format instead of general.
Steps followed are:

  1. Open file in Excel applications scope.
  2. Read the values using read range activity and export it to data table.
  3. Filter values in data table and write values using write range activity by opening new file in excel application scope.

Does anyone know how to write the numeric values directly to excel file instead of generic?

Any help will be of great help.

Thanks
Chetan

I haven’t tried but can you check by building a new data table with column data types and try to export that data table, check if it retains the data type.

Regards,
Karthik Byggari

@chetanRPA
I can see two possibilities-

  1. Use write range and write the data in excel. Then open excel, select the columns for which you want to change datatype and apply the format you want.

  2. Create a new table with the specified column in required format. Once Filter is applied on input data table, add those filtered values in the newly created table with proper type conversion.

Hi Karthik and Madhavi,
Thanks for your responses. In my case, the issue was not due to read range activity. of excel application scope. The issue was effect of unstructured data file which was generated through one of the local applications. The file was not parsed correctly by Excel application scope. So even before using read range activity, when file is opened into Excel scope, it has wrong numeric (baseline values of dates in excel) partially.

Solution: We imported data using excel utility ‘Import from text’ from data tab. The rest of the code worked properly.

Thanks,
Chetan

That was the code in my workflow. Sometimes Uipath parser fails to understand underlying data types and values in case of date columns for unstructured files. Hence, regular way of building data tables or directly exporting to datatable in output property didnt work.