Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 806
  • Last Modified:

Converting a .CSV format to a 97-2003 .XLS format

Is there a VB script where i can take a .csv file and convert it to a MS Excel 97-2003 .xls format?  I want to automate the process of opening a .csv file in Excel, doing the save as, selecting "Microsoft Excel 97-Excel 2003 &5.0/95 Workbook (*.xls)" and saving.  Is this possible?
0
rortiz77
Asked:
rortiz77
  • 2
  • 2
1 Solution
 
samopalCommented:
dim oEx
set oEx=Createobject("Excel.Application")
oEx.Workbooks.Open "C:\Test\Book1.csv"
oEx.ActiveWorkbook.SaveAs "C:\Test\Book1csv.xls", -4143, , , False, False
oEx.Quit
0
 
rortiz77Author Commented:
Samopal....your a rock star!!! Thanks  B^)
0
 
rortiz77Author Commented:
Hmmm...don't supposed you have another trick up your sleeve.  The sever doesn't have MS-Excel installed so it can't find the needed files.  I get error:

"ActiveX component Can't create object: 'Excel.Application'
Code: 800A01AD
Source: Microsoft VBScript runtime error"
0
 
samopalCommented:
If you want to convert your file to Excel, you should have Excel installed - I cannot see any other way.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now