sdfreed
Materials
- Oct 26, 2003
- 6
o.k. here I go again.
I am importing text files into my vba macro with the data to be processed. I have everything on a disk (A:\). When I go to a different computer to run the macro, the program doesn't know where to find my text files.
If I show the path by: opening the spreadsheet -> file -> open -> a:\ the macro runs fine. I recorded this and the recorder shows ChDir "A:\" I put that at the begining of the macro and it works great.
The question boils down to; what if I emailed all of the documents and don't know where the user is going to save them? Would I use an if then else statement?
ChDir "A:\"
if filename = "supplier*" + ".txt"
then = true
else chdir "c:\"
if filename = "supplier*" + ".txt"
then = true
else ???? end???
I am just not sure on how to write this, or if I am on the right track. Does this make any sense to anyone out there?
SDFreed
I am importing text files into my vba macro with the data to be processed. I have everything on a disk (A:\). When I go to a different computer to run the macro, the program doesn't know where to find my text files.
If I show the path by: opening the spreadsheet -> file -> open -> a:\ the macro runs fine. I recorded this and the recorder shows ChDir "A:\" I put that at the begining of the macro and it works great.
The question boils down to; what if I emailed all of the documents and don't know where the user is going to save them? Would I use an if then else statement?
ChDir "A:\"
if filename = "supplier*" + ".txt"
then = true
else chdir "c:\"
if filename = "supplier*" + ".txt"
then = true
else ???? end???
I am just not sure on how to write this, or if I am on the right track. Does this make any sense to anyone out there?
SDFreed