VBE

LAS

Board Regular
Joined
Oct 29, 2002
Messages
215
Does anyone have code to import code sitting in a text file into a module?

Thanks

Lawrence
 
On 2002-12-17 16:58, NateO wrote:
Howdy y'all, might want to have a look at:

http://www.cpearson.com/excel/vbe.htm

The section on copying modules between projects. You won't want the export, but the import could be handy.

Another way to pluck a duck. E.g.,<pre>
Sub ImportModule()
Dim FName As String
FName = "c:tempcode.txt"
ThisWorkbook.VBProject.VBComponents.Import FName
End Sub</pre>

_________________
Cheers,<font size=+2><font color="red"> Nate<font color="blue"> Oliver</font></font></font>
This message was edited by NateO on 2002-12-17 17:45



This one doesn't seem to like notepad text documents either. Hmmm...

Alright, I'm just gonna throw out notepad!
This message was edited by Aaron Blood on 2002-12-18 10:25
 
Upvote 0

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Alright I finally figured out my notepad textfile problem...

I had the textfile encoding set to "Unicode" when saving the textfile in Notepad.

If I set the encoding to ANSI and save it order returns to the universe. :biggrin:
 
Upvote 0

Forum statistics

Threads
1,215,500
Messages
6,125,168
Members
449,211
Latest member
ykrcory

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top