Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 current directory
Index -> Programming, Visual Basic and Other Basics -> Other Basics
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
greenapplesodaex




PostPosted: Fri Apr 15, 2005 12:54 pm   Post subject: 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
Sponsor
Sponsor
Sponsor
sponsor
Cervantes




PostPosted: Sat Apr 16, 2005 6:56 am   Post subject: (No subject)

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




PostPosted: Thu Apr 28, 2005 9:18 pm   Post subject: (No subject)

Try App.Path to obtain the path the program is running from.
diqua




PostPosted: Thu May 05, 2005 6:26 pm   Post subject: (No subject)

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
Display posts from previous:   
   Index -> Programming, Visual Basic and Other Basics -> Other Basics
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: