View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
[email protected] ggroups@ezwal.fastmail.fm is offline
external usenet poster
 
Posts: 2
Default writing a text file in the same folder as my program



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

2. If you really want to set it to the directory of the Excel
executable (excel.exe) you can use ChDir Application.path