Guten Morgen,
Ich hatte mir mal was rausgesucht für die Zukunft, weil ich das auch noch machen muss, aber ist bisher ungetestet
C#-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20:
| private void button1_Click(object sender, EventArgs e) { Excel.Application xlApp ; Excel.Workbook xlWorkBook ; Excel.Worksheet xlWorkSheet ; object misValue = System.Reflection.Missing.Value;
xlApp = new Excel.Application(); xlWorkBook = xlApp.Workbooks.Open("test.xls", 0, true, 5, "", "", true, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, "\t", false, false, 0, true, 1, 0); xlWorkSheet = (Excel.Worksheet)xlWorkBook.Worksheets.get_Item(1);
MessageBox.Show(xlWorkSheet.get_Range("A1","A1").Value2.ToString());
xlWorkBook.Close(true, misValue, misValue); xlApp.Quit();
releaseObject(xlWorkSheet); releaseObject(xlWorkBook); releaseObject(xlApp); } |
Vielleicht hilft es dir.
ich weiß nicht, ob ich den Link zur Seite posten darf, daher lasse ich es erstmal
