How to read a text file in VB. I'm going to access many text files in my VBA program but want to do it neatly. For eg.in my codes, if I have a string named "_APP_PATH" my program shoud access a txt file called "config.txt" and read line by line for the word "_APP_PATH". If it finds it, that means the line below that word is the directory path eg. "C:\windows\desktop\create"...so this string(the path) should be assigned to "_APP_PATH" in my codes...How to doit? Any better way.Attached is how the text file should look like.PLs..I need a solution for it.Pls helpThanks alot.
You can do something loike that (storing data) in an INI-file . Use the API-Calls getprivateprofilestring and writeprivateprofilestrig to do that (neatly)
Since you are using VBA, why don't you store the data in "parent" file (i.e. the file which holds the VBA-source code).
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!