Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Joe
"JoeU2004" wrote: wrote: Is it possible to Transfer/Open "Read" a text file into VBA Module? The following example provides some useful elements. Be sure to read the notes that follow. Const path As String = "c:\documents and settings\myname\my documents\somefile.txt" Dim data As String Dim fd As Integer fd = FreeFile Open path For Input Access Read As #fd Do Until EOF(fd) Line Input #fd, data ' do something useful with data Loop Close #fd Notes: 1. You can use a constant, starting with 1, instead of using FreeFile. 2. If your text file has some structure (e.g. a CSV file), you should also see the Help page for the Input statement. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
"Read Only" error when attempting to open EXCEL file | Excel Discussion (Misc queries) | |||
Unable to open a 82 KB XLSM file due to "Too many different cellformats" & "Converter failed to open the file." errors. | Excel Discussion (Misc queries) | |||
"Cannot access read-only document" (I get this error when I try to open an Excel file) | Excel Discussion (Misc queries) | |||
"Cannot access read-only document" (I get this error when I try to open an Excel file) | Setting up and Configuration of Excel | |||
Excel 2002/2003 can not open xls file says "may be read only" | Excel Discussion (Misc queries) |