Well, I think you are using ExportDataTable() method of Aspose.Cells.Cells class. For your information, the datatype for a column is determined by the very first value in that column, if it is numeric then the data type would be numeric for the field, if it is string, then it will be string data type.
The Cells.ExportDataTable() method also decides which data type would be setup for particular column in Excel sheet. By default, it is based on the first value (normally) in the column too, if it is string value, then the DataColumn would have string data type for the data table, if it has numeric value, the numeric data type would be taken for the column. I think for your case (as you are getting some error which is logical too), you may try any one option:
1) You may define your desired DataTable based on your desired columns and specify your desired data types accordingly. Then use the relevant ExportDatatTable() overloaded version to store the data into it.
See the sample code segment below:
e.g
DataTable dt = new DataTable();
dt.Columns.Add(“column1”, typeof(string));
dt.Columns.Add(“column2”, typeof(string));
dt.Columns.Add(“column3”, typeof(string));
dt.Columns.Add(“column4”, typeof(double));
dt.Columns.Add(“column5”, typeof(double));
dt.Columns.Add(“column6”, typeof(double));
dt.Columns.Add(“column7”, typeof(double));
//…
worksheet.Cells.ExportDataTable(dt, 0, 0, 1000, true);
2) Alternatively, you may use ExportDataTableAsString() method, but in this case all the data would be exported as string/text.
Thank you.