I get result sets from Sybase that I return to the C # client.
I use the following function to write result set data in Excel:
private static void WriteData(Excel.Worksheet worksheet, string cellRef, ref string[,] data)
{
Excel.Range range = worksheet.get_Range(cellRef, Missing.Value);
if (data.GetLength(0) != 0)
{
range = range.get_Resize(data.GetLength(0), data.GetLength(1));
range.set_Value(Missing.Value, data);
}
}
Data is being written correctly.
The problem is that since I use a string array to write data (which is a mixture of strings and floats), Excel selects every cell that contains numeric data with the message "The number is stored as text."
How can I get rid of this problem?
Thanks a lot Chapax
source
share