hallo,
ich möchte gerne den Inhalt von einem datagridview in einer Excel Datei speichern.
Meine Vorlage:
code.msdn.microsoft....ataGridView-62f1f8ff
C#-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11:
| ...... private void ExportToExcel() { Microsoft.Office.Interop.Excel._Application excel = new Microsoft.Office.Interop.Excel.Application(); Microsoft.Office.Interop.Excel._Workbook workbook = excel.Workbooks.Add(Type.Missing); Microsoft.Office.Interop.Excel._Worksheet worksheet = null;
try { ...... |
Alle Wörter mit Office sind Rot unterschriechen.
Laut google suche soll ich : add ref. > Microsoft.Office... // gibts es aber nicht.
o2010pia.exe habe ich auch installiert, aber ohne Erfolg.
Moderiert von Christian S.: Code- durch C#-Tags ersetzt
Moderiert von Th69: Beitragsformatierung überarbeitet (und .NET Version auf 4.5 gesetzt, anstatt Silverlight).