Import .txt macro - user defined file name

G

Guest

I have a macro which will import my .txt file just fine. The problem is that
I have a new file coming in a few times each week. I have been changing the
name of the file to match my import macro file name each time. I would like
for the macro to allow me to browse for the file, then import the one I
select. Any Ideas?

Thanks,

Arch
 
N

Nikos Yannacopoulos

Arch,

AFAIK you cannot do that in a macro. It's very easy to do it in a VBA
code procedure, though. Start by converting your macro to a module, and
incorporate the API call from:

http://www.mvps.org/access/api/api0001.htm

to get the file name through the standard Windows File Open dialog,
instead of hardcoding it.

HTH,
Nikos
 

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