Code for TransferText

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a working macro with the action of TransferText importing a fixed
width file using a specification name and the full path to the txt file to be
imported.

The change I need to make is to allow the user to specify the file name
because the name of the file to be imported is now variable.

I believe I can no longer use the macro and need to do this in code. I
could have a control table with a field for the path and then have the user
enter just the file name.

Can you provide me with or point me to a complete piece of code I can use?
I'm hoping to cut and paste it into the code window and replace the specifics
with my file name, specification name, path, etc.

Then, I assume my button can be changed from "Run Macro <macroname>" to "Run
code <codename>".

I read some other related postings but I couldn't make the connection to
exactly what I needed to do.

Thank you for your help.
 
You can bring up a dialogue box which will capture the users file selection.
Try an internet search on "GetOpenFile" and "Ken Getz" and/or "Waite Group
Press". I have free code which works but is too long to place here.
 
Thanks for responding, OE, but I couldn't find it.

It's ugly but I could always make the user rename the file to the expected
filename and keep using the macro. I'm uncomfortable at the code level
anyway.
 
Back
Top