Excel: Numbers are stored as text

Hello,

I’m trying to copy a range of data from one excel workbook to another. However the copied data is pasted to the new workbook all the numbers gets stored as text.

I tried doing a get row item → convert to double → and update row item

I get the following message though: “Get Row Item: 787,78 is not a valid value for Double.”

How is that not valid for a double?

the comma is confusing the default conversion/parsing.

We assume your locals is somewhere in Scandinavia?

grafik

Double.Parse("787,78", new System.Globalization.CultureInfo("xx-XX"))
xx-XX for Denmark dk-DK

feel free to adopt the locals to your needs

1 Like

Thanks for the quick answer, Peter - you kinda solved the issue.

“Next” issue is the data looks like this now:

As you can see the value is there, but Excel see it as… I don’t know? Percentage now?

The workflow is as this:

Download Excel file containing data
Write to datatble
Update each row (P) to double
Write datatable to another workbook

Is there another or better way of doing this?

Kind regards, Max

(And you guessed correctly about the country :P)

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