Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Import list of modules (bas files) using VBA

Status
Not open for further replies.

xitu

Technical User
Oct 1, 2003
55
US
I have about 20 modules in folder C\modules
I created a text file that contains only modules I want to import in C:\modules\list.txt

list.txt
module1.bas
module6.bas
module10.bas


Does anyone know how to import the modules in list.txt into a Project's Modules using VBA?

Many thanks,
XT
 
Can you not just do ctrl-a to select all, then copy each one, and paste it to a module in vba? I mean, it would take longer to do the vba code most likely than to just copy and paste the text from the text document to the module(s) where you want it (if you are only doing this once).

Stephen [infinity]
"Jesus saith unto him, I am the way, the truth, and the life:
no man cometh unto the Father, but by me." John 14:6 KJV
 
I am writing tools for users using VBA. A menu will be added when a user opens the application. In this menu, the code will read the text file and import the modules. This menu will be changed frequently. It would be nice if I can add/ remove modules from a text file instead of editing in my VBA code.

Thanks,
XT

 
You might be able to take advantage of the AddFromFile method of the Module object.

Good Luck
--------------
To get the most from your Tek-Tips experience, please read FAQ181-2886
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top