View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default Possible to Transfer/Open "Read" a text file into VBA Module?

Sorry, I meant to give you the code to read in the file...

Dim X As Long
Dim FileNum As Long
Dim TotalFile As String
.....
.....
FileNum = FreeFile
Open "C:\TEMP\TestData.txt" For Binary As #FileNum
TotalFile = Space(LOF(FileNum))
Get #FileNum, , TotalFile
Close #FileNum
'
' The TotalFile variable now contains the entire text from
' the file specified in the Open statement (obviously change
' the same file name and path to the one you want

--
Rick (MVP - Excel)


"Rick Rothstein" wrote in message
...
You might want to provide a little more detail in your question. What did
you have in mind by "transfer"? You can open a text file and read its
contents into a String variable easy enough... but what are you looking to
do with it afterwards that you restricted your question to a "VBA Module"?

--
Rick (MVP - Excel)


wrote in message
...
Is it possible to Transfer/Open "Read" a text file into VBA Module?