Exporting Excel file to CSV formatted file. 
Author Message
 Exporting Excel file to CSV formatted file.

I am writing a VB6 utility that will extract data from a
MS Excel 2000 file and outputs to a CSV formatted file. I
know how to read an Excel file and output to a text file
but don't know how to output to CSV.
Any help, suggestions would be highly appreciated.

Thanks



Sat, 02 Jul 2005 06:46:32 GMT  
 Exporting Excel file to CSV formatted file.

CSV is just a text file with comma-separated columns.

--
............................................
Bj?rn Holmgren
Guide Konsult AB
............................................


Quote:
> I am writing a VB6 utility that will extract data from a
> MS Excel 2000 file and outputs to a CSV formatted file. I
> know how to read an Excel file and output to a text file
> but don't know how to output to CSV.
> Any help, suggestions would be highly appreciated.

> Thanks



Sat, 02 Jul 2005 21:11:24 GMT  
 Exporting Excel file to CSV formatted file.

I am writing a VB6 utility that will extract data from a
MS Excel 2000 file and outputs to a CSV formatted file. I
know how to read an Excel file and output to a text file
but don't know how to output to CSV.
Any help, suggestions would be highly appreciated.

Sub ExportToTextFromExcel()

Dim cnn As New ADODB.Connection
Dim sqlString As String

cnn.Open _
   "Provider=Microsoft.Jet.OLEDB.4.0;" & _
   "Data Source=D:\My Documents\Book2.xls;Extended Properties=Excel 8.0;"

'sqlString = "SELECT * INTO [Text;DATABASE=D:\My Documents\TextFiles].[Sheet4.csv] FROM
[Sheet1$A3:D7]"

sqlString = "SELECT * INTO [Text;DATABASE=D:\My Documents\TextFiles].[Sheet4.csv] FROM [Sheet4]"

cnn.Execute sqlString

cnn.Close
Set cnn = Nothing

End Sub


Microsoft MVP (Visual Basic)



Sat, 02 Jul 2005 23:10:55 GMT  
 Exporting Excel file to CSV formatted file.
Can't you just save an Excel file in .CSV format?  Why would you need a
utility to do this?

Later, Charles



Sun, 03 Jul 2005 01:49:39 GMT  
 Exporting Excel file to CSV formatted file.

Can't you just save an Excel file in .CSV format?  Why would you need a
utility to do this?

Sure you could as long as the Excel application is installed. In addition, it would probably be
slower if you needed to automate this process.


Microsoft MVP (Visual Basic)



Sun, 03 Jul 2005 04:21:03 GMT  
 Exporting Excel file to CSV formatted file.

Quote:
>-----Original Message-----
>I am writing a VB6 utility that will extract data from a
>MS Excel 2000 file and outputs to a CSV formatted file. I
>know how to read an Excel file and output to a text file
>but don't know how to output to CSV.
>Any help, suggestions would be highly appreciated.

>Thanks
>.
>I am extracting, validating and parsing data and

outputting CSV file for a specific need that requires a
custom utility.


Tue, 12 Jul 2005 08:27:56 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. save excel file as csv format as part of macro

2. save excel file as csv format as part of macro

3. Export an Access Table to Excel File Format

4. Using FSO to append multiple .csv excel files into one file

5. Exporting to Excel 97 file format using version 6.0

6. Export to csv text file

7. Exporting to a CSV file and scientific notation

8. How to export a Recordset to an external .csv file

9. exporting data in a recordset to a CSV file

10. Export to *.csv file

11. Limits on import/export of a CSV file

12. urgent: importing and exporting csv files

 

 
Powered by phpBB® Forum Software