|
Getting text file into a VBA string variable
Try this
Open "C:\Myfile.txt" for input as #1
Input #1, ShortText
Close #1
Mystring=ShortText
"Don Wiss" wrote:
> I'd like to read a short text string in from the hard disk and assign it to
> a VBA string variable. I hunted around in the VBA help file, and couldn't
> find anything on getting files. I don't want to open a file and put it onto
> a Worksheet and then read it from there. (And then close the Sheet.) A bit
> of overkill for a four character long file.
>
> Don <donwiss at panix.com>.
>
|