change file type via code

M

mhmaid

I have more than 200 excel sheets files , each file contains one record
these files are created automatically thru our mdis system , which will
export the date of a single record to a xl file ,

what i want to do is , importing the data to a new table in access
when i try to open , i got an error msg , because the files are saved as
text( tab delimited)

in order to be able to import a file to access , i first need to open each
file and save it as of type excel

but is is possible to change the type of all of the files by code
all files are kept in one folder in c drive

hope some ones knows how to do this
thanks
 
K

kc-mass

There is no need to open the files in Excel. You can import the delimited
data directly
to an access table. Look in the Access help for "TransferText".

Regards

Kevin
 
A

Arvin Meyer MVP

mhmaid said:
I have more than 200 excel sheets files , each file contains one
record these files are created automatically thru our mdis system ,
which will export the date of a single record to a xl file ,

what i want to do is , importing the data to a new table in access
when i try to open , i got an error msg , because the files are saved
as text( tab delimited)

in order to be able to import a file to access , i first need to open
each file and save it as of type excel

but is is possible to change the type of all of the files by code
all files are kept in one folder in c drive

Access will directly open and read various types of files including TXT,
CSV, and XLS files without any changing or conversion. Set your import
dialog to the proper filetype and you won't have to worry about converting
anything. If you want to rename files, use the Mid() function to find the
first instance of a . (period or dot) and capture the rest of the filename
(the extension) the use rename to change it as in:

RENAME [drive:][path]filename1 filename2

or:

REN [drive:][path]filename1 filename2
 

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