¤ Hi friends,
¤
¤ I m just stuck with extracting excel file data into text file.
¤ So can any body please help me out.
¤ thx,
¤ Sachin.
The following will export to a comma delimited file:
Dim ConnectionString As String
ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\Test Files\Book20.xls;Extended Properties=Excel 8.0;"
Dim ExcelConnection As New System.Data.OleDb.OleDbConnection(ConnectionString)
ExcelConnection.Open()
Dim SQLString As String = "SELECT * INTO [Text;DATABASE=C:\Documents and Settings\...\My
Documents\My Database\Text].[ReportSheet.txt] FROM [ReportSheet$]"
Dim ExcelCommand As New System.Data.OleDb.OleDbCommand(SQLString, ExcelConnection)
ExcelCommand.ExecuteNonQuery()
ExcelConnection.Close()
Paul
~~~~
Microsoft MVP (Visual Basic)