It is a simple .NET module (Excel.cs) to assist in the exchange data Between Excel and .NET using COM but without using Interop.Excel.dll (900K), Iterop.Office.dll(150K), Interop.VBIDE.dll. Full source code and exe-demo application included.
This module is FREEWARE .
Demo code:
using ( Sheet sh = excel.Workbooks[1].ActiveSheet()) {
using ( Range r = sh.Ranges["R1C5"]) {
r.Value = "123";
r.Font.Bold = true;
r.Font.Name = "Times New Roman" ;
r.Font.Color = System.Drawing.Color.Red;
r.HorizontalAlignment = Excel.xlHAlign.xlHAlignCenter;
}
}
converting data from DataGridView to MsExcel:
Excel.dataGridViewToExcel( 1, 1, yourDataGridView, null, null);