View Single Post
  #11   Report Post  
Posted to microsoft.public.excel.programming
Don Wiss Don Wiss is offline
external usenet poster
 
Posts: 300
Default Getting text file into a VBA string variable

On Thu, 6 Jan 2005 08:51:55 -0500, Tom Ogilvy wrote:

Function OpenTextFileToString2(ByVal strFile As String) As String
' RB Smissaert - Author
Dim hFile As Long
hFile = FreeFile
Open strFile For Input As #hFile
OpenTextFileToString2 = Input$(LOF(hFile), hFile)
Close #hFile
End Function


Works like a charm. Nice and simple. I can feed the output of this function
directly into a user form textbox.

Thanks, Don <donwiss at panix.com.