retrieving Text from a textfile in Excel

S

Silencer116

Hi again!

I am using some methods to create a textfile with just one line. Like "
The process begun at monday 3 PM" or something like that. This line
will always be updated (actually the whole file).

But now i would like the following:

i would like to have the text in the textfile being displayed in a
msgbox in Excel. It's only one single line, but it could be considered
as everything (all text) in the textfile.

Could someone help me on this ?
 
I

Ivan Raiminius

Hi,

only part of code, that you can incorporate into yours:

Dim fsFs As Object
Dim fsInput As Object

Set fsFs = CreateObject("Scripting.FileSystemObject")
Set fsInput = fsFs.OpenTextFile(Filename:=InputFile, _
IOMode:=ForReading, create:=False,
_
Format:=TristateUseDefault)
msgbox fsInput.readline
fsInput.close

'Input file = full file name including path

Regards,
Ivan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top