Results 1 to 3 of 3
  1. #1
    shabar is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jan 2013
    Posts
    66

    Read excel/text file thro VBA

    Hi All



    Is it possible to read text/excel file line by line thro VBA


    Cheers


    Shabar

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Sort of. This is a common topic. Search forum or Google. Code is different for text and Excel files.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    shabar is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jan 2013
    Posts
    66
    Thax June7

    I found following. It works for me

    Dim FileName As String
    Dim FileNum As Integer


    Dim strTable, strColumn As String




    FileName = "C:\Temp\TableName.txt"


    FileNum = FreeFile()
    Open FileName For Input As #FileNum


    Do Until EOF(FileNum)
    Input #FileNum, strTable, strColumn
    Loop
    Close #FileNum



    Cheers

    Shabar

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 05-23-2012, 03:05 AM
  2. Replies: 5
    Last Post: 02-24-2012, 11:02 AM
  3. Read text file with LF
    By SteveG in forum Programming
    Replies: 8
    Last Post: 12-24-2011, 09:57 AM
  4. Err 7-out of memory, read text file
    By dssrun in forum Programming
    Replies: 4
    Last Post: 12-04-2011, 01:06 AM
  5. Replies: 2
    Last Post: 02-27-2010, 06:53 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums