billdvldog
Programmer
- Sep 6, 2001
- 43
I have tried modifying SarkMan's previously posted code (from 10/02/2003 - below with my modifications) to open the CSV file using Excel and simply saving the file with an xls extension. Unfortunately this puts all the data into a single column in Excel. I'm not sure why this is happening. When I manually open the CSV file using Excel and save it as an Excel file it formats the file correctly.
Thanks in advance for your help!
Bill
<code>
set xlApp = CreateObject("excel.application"
xlApp.Visible = false
xlApp.DisplayAlerts = False
newFileName="C:\test.xls"
xlApp.Workbooks.Open "C:\test.csv"
xlApp.ActiveWorkbook.SaveAs newFileName
xlApp.ActiveWorkbook.Close(0)
xlApp.Quit
Set xlApp = Nothing
</code>
Thanks in advance for your help!
Bill
<code>
set xlApp = CreateObject("excel.application"
xlApp.Visible = false
xlApp.DisplayAlerts = False
newFileName="C:\test.xls"
xlApp.Workbooks.Open "C:\test.csv"
xlApp.ActiveWorkbook.SaveAs newFileName
xlApp.ActiveWorkbook.Close(0)
xlApp.Quit
Set xlApp = Nothing
</code>