Ttext to number excel

Hello everyone, I am copying a CSV file to paste it into an Excel template file. However I have a small concern about a column where data must be numbers and not text. When I do it manually it works, however when I do it via my automation I have this error:

image
Number stored as text

Do you know how I can paste my data without having to change all the cells?

You don’t copy/paste into Excel. Use the Excel activities.

1 Like

Hi @DimitriLYR ,

I’m not sure if I’ve understood your query completely, but do you want Excel to categorize it as a Number is that correct?
image

If so then using a bit of VBA wouldn’t hurt here.

Function changeColFormat(str_sheetName As String, Col As Long)
Dim Sh As Worksheet

  Set Sh = ThisWorkbook.Worksheets(str_sheetName)
  Set Sh = ThisWorkbook.Worksheets("Sheet1")
  Sh.Columns(Col).NumberFormat = "0.00"

End Function

Check the box for “Trust Access” in Trust Center

use an Invoke VBA Activity and save the snippet about into a Notepad and invoke it within an Excel Application Scope like so:

image

This doesn’t get rid of the warning though.
Let me know if that is what you were targetting, because VBA can help with that as well.

Kind Regards,
Ashwin A.K

1 Like

Hi @DimitriLYR

Have a look on the thread

Hope it will helps

Regards
Gokul

1 Like

Hello, thank you all for your answers, I will test this in the morning :slight_smile:

It’s Done, thank you all :slight_smile: i use @ashwin.ashok 's method :slight_smile:

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