Wrong Format

R

Ray

I have several files downloaded for me that are supposed to be in .xls
format. I believe they are really .csv files with a .xls extension. I am able
to save them as Excel Workbooks by opening each one and doing a Save As.
There will be several of these files in a folder on my desktop and I will
need to convert many of these files each day.

Is there a way I can convert them into an Excel Workbook format using VB?
 
S

Scott Lichtenberg

Ray,


There are two approaches that you can look at. The first would be to use
OLE - actually opening an Excel application with Access, then issuing
commands through Excel to open and save your files. I haven't done this in
years, and not with newer versions of Access, but I would imagine that OLE
still exists.

If you wanted more of an Access based solution, you could use the DIR
function to look for files in a directory. For each file, use the
TransferText command to import it into an Access Table. You can then use
the TransferSpreadsheet command to export it.

You should also look at doing this with VBA in Excel.
 
R

Ray

I can do the import and export, but how do I step thru each file
automatically? The only files in the folder will be the ones I need to change
so I will need to do it to all of them, not selected ones if that makes it
any easier.
 

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