1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
private Microsoft.Office.Interop.Excel.Workbooks oBooks;
private Microsoft.Office.Interop.Excel.Workbook oBook;
private Microsoft.Office.Interop.Excel.Worksheet oSheet;
Microsoft.Office.Interop.Excel.ApplicationClass exc;
Object oRien = System.Reflection.Missing.Value;
private void button1_Click(object sender, EventArgs e)
{
int feuille = 1;
System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US");
exc = new Microsoft.Office.Interop.Excel.ApplicationClass();
exc.Visible = true;
oBooks = exc.Workbooks;
oBook = oBooks.Open("c:\\Geo.xls", oRien, oRien, oRien, oRien, oRien, oRien, oRien, oRien, oRien, oRien, oRien, oRien, oRien, oRien);
oSheet = (Microsoft.Office.Interop.Excel.Worksheet)oBook.ActiveSheet;
Console.Write(oSheet.Cell[2,2]);
} |
Partager