Hi I need to change number column as text column, can u help in this
Thank you for contacting Aspose support.
We believe you are using Aspose.Cells API and wish to format the column of a spreadsheet. If we are correct in our understanding, please read more about Setting the Display Format and check the below provided code snippet. The source code example loads a spreadsheet having two columns of data and sets the style for the second column to text format. We have attached the input & output spreadsheets for your reference.
//Instantiating a Workbook object
Workbook workbook = new Workbook(“D:/temp/book1.xlsx”);
//Obtaining the reference of the first (default) worksheet by passing its sheet index
Worksheet worksheet = workbook.Worksheets;
//Adding a new Style to the styles collection of the Excel object
int i = workbook.Styles.Add();
//Accessing the newly added Style to the Excel object
Style style = workbook.Styles[i];
//Number 49 denotes to the text style
style.Number = 49;
StyleFlag styleFlag = new StyleFlag();
//Set NumberFormat to true
styleFlag.NumberFormat = true;
//Apply the style to the desired column
//Saving the Excel file
In case you have further concerns or questions, please feel free to write back.