
-----------------------------------
greenapplesodaex
Fri Apr 15, 2005 12:54 pm

current directory
-----------------------------------
This is for VBA and i cant find anything on this

say i have my application saved under "c:\work\"
and i want to use the program i'm making to create folders under "c:\work" (so it's gonna be something like "c:\work\newfolder")
when i tell the program where to make the new folder, is there a way where i dont have to add "c:\work\"? i mean, if i move the whole project to d drive the path is gonna be "d:\work\" and i have to change every "c:\" to "d:\"
how can i make new folders in the current directory? thanx

-----------------------------------
Cervantes
Sat Apr 16, 2005 6:56 am


-----------------------------------
I'm don't know VBA, but can you not just type in the file name, not the path?  Perhaps if you don't type in the path, VBA will assume to work in the directory that your program is running from.  Can't be sure though, that's just a guess.
Alternatively, you could have a string variable to store the path.  This would work fine if you were to install your program (ie. set that string variable to the path when you install the program), but it wouldn't work if you were to suddenly cut & paste your folder/files.

-----------------------------------
betaflye
Thu Apr 28, 2005 9:18 pm


-----------------------------------
Try App.Path to obtain the path the program is running from.

-----------------------------------
diqua
Thu May 05, 2005 6:26 pm


-----------------------------------
look for "option explicit" if its there it wont allow you to do relative paths

im not too sure about this though
oh well its two words
