DoCmd line to save an .xls as .csv

S

SoDakRah

I recieve a file in .xls format and must read it as .csv without wanting to
open the file in Excel and saving it as .csv. Is there a way using a DoCmd
to accomplish the same task?
 
P

Pete D.

CVS would be down grading the file import abilities. Why must you import it
as CSV? Why not link to it and use a query to fix it up?
 
S

SoDakRah

I should have clarified things. The file I recieve is a datastream with only
CR's at the end of the record. No comma or tab charaters. It is sent to me
with a .xls extension not excel formating. The more I think about it, I only
need to read the first 10 characters of each line so that might simplify
things. Can I write code to open the file and loop through the file getting
just the first 10 characters and output them to a temporary table?
 
P

Pete D.

Please don't take this wrong! There is something wrong if you recieve it
with XLS extension and it is just a text file (I assume from your
description). That being said, first thing is to rename the file to
something Access can understand what it is such as ".txt". With the xls
extension it isn't going to provide you the options you want. Now you can
create an import specification for the file, save it and use a macro to
import it over and over. You can easily import the first 10 characters
using the native import abilities of access once it know this is a text
file.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top