John Beeman

John Beeman

  • NA
  • 15
  • 0

C# Import multidimensional array into Excel and parse column to number?

Aug 29 2008 1:56 AM
Using the code snippet below in my Visual C# winform, I can successfully import an array to an Excel file, but I would like 2 of the columns to import as numbers instead of strings and not sure how to do this because the numbers won't calculate in the spreadsheet link. Of course, it isn't hard to do this within Excel, but when be a little more user-friendly if I could this on the import. Can anyone assist me? Thanks, JB

m_objRange = m_objSheet.get_Range("A2", m_objOpt);
m_objRange = m_objRange.get_Resize(arrayrows , arraycolumns);
m_objRange.Value2 = excelSheet;