310
Views
4
Comments
[Advanced Excel] Advanced Excel , data should be in number format instead of text
advanced-excel
Service icon
Forge asset by Carlos Freitas

how to make data in excel column as integer instead of text ?? 
Advanced Excel , data should be in number format instead of text
how to do that !!!

i keep get error , input string incorrect format 



UserImage.jpg
Omar AbdElhadi

how to make data in excel column as integer instead of text ?? 



UserImage.jpg
Wieger Tuininga

Hi Omar,

Your CellValue is a text-string. Your CellType is an integer. A text is not an integer, so the error correctly appears saying "input string incorrect format".

Change the CellType to "" (an empty value), allowing any input there.


Cell_write only fills 1 cell with a value.

If you want to dynamically fill a row or column, you will have to use a for-loop for each value you want to fill.


An example here:

A list of countries added one by one.


I don't know if that is what youre looking for. If it is, you define the first cell_write as CellType "" and then in the cell below dynamically add the integer values with the for-loop.

I do recommend looking into other ways to add data to an excel-sheet, as I would generally not use a for-loop for this.

If this solves your issue, please mark it as a solution.

Greetings,

Wieger



2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Wieger,

I'm not too familiar with Adanced Excel, but CellValue will always be a Text, as that's the data type of that parameter to Cell_Write? But indeed "Number Panels" doesn't contain something that can be converted to an integer, hence (probably) the error.

2022-12-09 09-54-41
Gaurav Rawat

Hi Omar AbdElhadi,

I you can achieve it using the format in by providing "0" in NumberFormat field inside cellFormat like this.


You will get the exported excel column like this.



Thanks,

Gaurav Rawat

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.