Hallo alle zusammen,
ich hoffe ihr könnt mir weiter helfen?
Möchte eine Datagrid in eine Exceldatei auslesen, wie man eine Exceldate erzeugt, und eine Tabelle anlegt ist kein Problem unten der Code.
Code:
Dim constringx as String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+ Speicherort +";Extended Properties=Excel 8.0"
Dim sqly as String = "CREATE TABLE [Tabelle2$]"
Dim conx as new OleDbConnection(constringx)
Dim cmdx as new OleDbCommand(sqly, conx)
Try
conx.Open()
cmdx.ExecuteNonQuery()
cmdx.CommandText = sqlx
cmdx.ExecuteNonQuery()
Catch exc as OleDbException
End Try
conx.Close()
Aber wie bekomme ich jetzt den Datagrid inhalt in Excel hinein. Und zwar das die erte Zeile bei Datagrid in Excel erst bei der 3 Reihe beginnt.
Danke in voraus
l.pesch
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP