With Regards,
Rama
"RamaKrishnan" <ra...@cspl.com> wrote in message
news:euPdmHne...@TK2MSFTNGP03.phx.gbl...
For most Office/VBA products, you can
1) Start a Macro
2) Do the SaveAs or whatever
3) Stop the Macro
4) View the VBA source for the Macro
In this case I get something like:
ActiveWorkbook.SaveAs Filename:="C:\YourPath\YourSheet.csv", _
FileFormat:=xlCSV, CreateBackup:=False
¤ Hello Friends,
¤ I am having a File in XLS Format. I need To convert this file to CSV File
¤ Format. through visual basic Code
¤
Sub ExportExcelToText()
Dim cnn As New ADODB.Connection
Dim strSQL As String
cnn.Open _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\Test Files\Book20.xls;Extended Properties=Excel 8.0;"
strSQL = "SELECT * INTO [Text;DATABASE=C:\Documents and Settings\...\My Documents\My
Database\Text].[ReportSheet.csv] FROM [ReportSheet$]"
cnn.Execute strSQL
cnn.Close
Set cnn = Nothing
End Sub
Paul
~~~~
Microsoft MVP (Visual Basic)
I am not to familiar with this, from the last post I don't get this line:
strSQL = "SELECT * INTO [Text;DATABASE=C:\Documents and Settings\...\My
Documents\My Database\Text].[ReportSheet.csv] FROM [ReportSheet$]"
what should I put in the [ReportSheet$] field?
Thanks in advance
Chris
¤ Hi,
¤
¤ I am not to familiar with this, from the last post I don't get this line:
¤
¤ strSQL = "SELECT * INTO [Text;DATABASE=C:\Documents and Settings\...\My
¤ Documents\My Database\Text].[ReportSheet.csv] FROM [ReportSheet$]"
¤
¤ what should I put in the [ReportSheet$] field?
¤
That would be the name of the Worksheet in the Workbook that you are exporting.