Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Myrna and Dick helped me get started on trying to open a .txt file. If I
hard-code the file path and name, I can use Shell to open it. But then I can't read the contents into a string. So I was trying to use Open And Read or ReadLine through the FSO. I guess the FSO is opening the file - it never becomes visible (which is okay), but the code drops to the Read line. But with either ReadLine or ReadAll, it errors out - "Input past end of file". Can someone shed some light, please? Ed Dim FSO As Object, File As Object, Contents As String Set FSO = CreateObject("Scripting.FileSystemObject") Dim strFName As String Dim strFPath As String strFPath = ActiveWorkbook.Path & "\" strFName = strFPath & "About.txt" Set File = FSO.OpenTextFile(strFName) Contents = File.ReadLine MsgBox Contents |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
FILE CAN ONLY OPEN AS READ ONLY | Excel Discussion (Misc queries) | |||
Excel file won't open because it' a read only file when it is not | Excel Discussion (Misc queries) | |||
How to Open file as read only | Excel Programming | |||
Open File Read Only | Excel Programming | |||
File in use open read only | Excel Programming |