Hi , I'm doing a VBA application. Inside my source codes, there are hundreds of locations where I'm accessing some folders to read.Actually my purpose of asking How to access a "Config file" in VB is bcoz, my app might be transfered to other PC. I want the users to set the folder paths in a text file for their comfort,lets say config.txt(in the format which I've attached or even better if u can think of).y? so that my vb program is maintainable and the users(NOT PROGRAMMERS) need not go thru the source codes to change the directory path one by one... It will be assumed that if they change the path in the txt file, then when they run the program, it should run without any problem(like File Does Not Exist)..and things like that...Understand my friend? So I want a code that could be placed with my source codes so that whenever I need to access a file, I need not do this:"c:/windows/GetTT/..." Instead I want to simply call "_App_Path", and so my program will read the config.txt line by line and when it sees "_App_Path", it will read the next line, which is the directory path(See my prev Attached).Hope u would help me...Thanks a lot.
Sounds like a good idea,
it has been done lot's of times
For VB programms I'd use ini-files. Look for the API's GetPrivateProfileString to read and WritePrivateProfileString an INI-File.
Since you are using VBA, your code is running with a file (excel or something) Why don't you save the data in there.
As for the code, just aasign at the start of the application the correct value for your Folder_Path and the nuse it.
You're welcome to rate this post!
If your problem is solved, please use the Mark thread as resolved button Wait, I'm too old to hurry!