On Tue, 24 May 2005 21:03:42 -0700, "Bill nguyen" <bi*****************@jaco.com> wrote:
¤ How can I open an Excel file then SAVE AS .CSV file using VB.NET?
¤
You can use ADO.NET to do this:
Dim ExcelConnection As New
System.Data.OleDb.OleDbConnection("Provider=Micros oft.Jet.OLEDB.4.0;" & _
"Data Source=e:\My Documents\Book20.xls;Extended Properties=""Excel
8.0;HDR=NO;IMEX=1""")
ExcelConnection.Open()
Dim ExportCommand As New System.Data.OleDb.OleDbCommand("SELECT * INTO [Text;DATABASE=E:\My
Documents\TextFiles].[Sheet4.csv] FROM [Sheet4$]")
ExportCommand.ExecuteNonQuery()
ExcelConnection.Close()
Paul
~~~~
Microsoft MVP (Visual Basic)