public void writeArray(String[,] saRet, long rows, int col)
{
Excel.Application objApp;
Excel._Workbook objBook;
Excel._Worksheet objSheet;
Excel.Range range;
objApp = new Excel.Application();
objBook = (Excel.Workbook)objApp.ActiveWorkbook;
objSheet = (Excel.Worksheet)objBook.Worksheets["Not COD"];
//Get the range where the starting cell has the address
//m_sStartingCell and its dimensions are m_iNumRows x m_iNumCols.
range = objSheet.get_Range("A1", Missing.Value);
range = range.get_Resize(rows, col);
//Set the range value to the array.
range.set_Value(Missing.Value, saRet);
//Return control of Excel to the user.
objApp.Visible = true;
objApp.UserControl = true;
}
} // Test
|