writing a text file in the same folder as my program
wrote in message
...
Takashi Yamauchi wrote:
Is there any way I can place "TestData.txt" in the same folder as
my program is placed?
I don't know what is setting or varying the working directory in your
case. But here are some ideas so you can set it yourself right before
the write:
1. Assuming you want to set it to the directory of your .xls file you
can use ChDir Activeworkbook.path
Thank you. This worked, but only when I'm running the program from my main
hard disk. When I was running the program from a USB stick, the TestData.txt
is still placed in "My Document"....
But this is good enough.
Thank you again
takashi yamauchi
2. If you really want to set it to the directory of the Excel
executable (excel.exe) you can use ChDir Application.path
|