Solved

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

Posted on 2007-03-21
4
796 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
This article will show, step by step, how to integrate R code into a R Sweave document
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

707 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now