transfrer spreadsheet - text file

M

Matt

I have code to import an Excel file as

DoCmd.TransferSpreadsheet acImport, , "StateMaster", "c:\StateMaster", True

I now want to import the same file as a text file. When I try to perfom
this action the code cannot find the file, I tried adding the extension and
still didin't work.

Any suggestions?

Thanks,
Matt
 
A

Amanda Payton

Matt -
I'm not sure why you would need to import the same file two different ways -
unless you were converting a file to Excel before importing it (and now want
to eliminate that step)

Anyway -

Make sure you're using the right command to import the file. When you're
working with text files, .csv files, and such, use

docmd.transfertext

instead of

docmd.transferspreadsheet

the two functions take a different approach to "reading" the data.

HTH

Amanda
 
Top