Solved

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

Posted on 2007-03-21
4
799 Views
Last Modified: 2011-09-20
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
Comment
Question by:rortiz77
  • 2
  • 2
4 Comments
 
LVL 9

Accepted Solution

by:
samopal earned 125 total points
ID: 18767460
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
 

Author Comment

by:rortiz77
ID: 18770833
Samopal....your a rock star!!! Thanks  B^)
0
 

Author Comment

by:rortiz77
ID: 18770925
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
 
LVL 9

Expert Comment

by:samopal
ID: 18773459
If you want to convert your file to Excel, you should have Excel installed - I cannot see any other way.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If like me you are one who spends a lot of time working and scripting with cmd.exe, sometimes it is handy to be able to quickly view a calendar for a given month and year. This script will quickly do just that!  Save the code posted below to a .bat …
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question