Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default retrieving Text from a textfile in Excel

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 ?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 258
Default retrieving Text from a textfile in Excel

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default retrieving Text from a textfile in Excel

Assign your text to a variable e.g. MyText and display that.....

MsgBox MyText

--
Cheers
Nigel



"Silencer116" wrote in message
oups.com...
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 ?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Autofit row height when retrieving text via formula andy62 Excel Discussion (Misc queries) 3 May 4th 08 01:46 AM
WHEN DOWNLOADING A TEXTFILE EXCEL DELETES BLANK ROWS - STOP THIS? shell3 Excel Worksheet Functions 0 October 21st 05 03:29 PM
Need to keep text format when retrieving records from database Markantesp Excel Programming 1 March 7th 05 02:43 AM
Retrieving text being typed and cursor position using VBA or automation, how? Kallepalle Excel Programming 2 May 23rd 04 12:40 PM
Excel VBA to access URL as Textfile Günter Kehrer Excel Programming 1 August 3rd 03 07:54 PM


All times are GMT +1. The time now is 08:59 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"