Results 1 to 4 of 4
  1. #1
    stalk is offline Competent Performer
    Windows 8 Access 2003
    Join Date
    May 2014
    Posts
    143

    Reading .xls file using VBA code


    How can I read the .xls file line by line and save to a table?
    File Name C:\temp\trpt.mdm
    Experiment Run End Time 2016-12-20 01:34:37 AM EST
    Instrument Type trial
    Passive Reference
    Dwell Sample Name Target Name Reporter MT MTMean
    B1 FTC PebA FOR Undetermined
    B2 S1 PebA FOR 29.10263 29.10263
    B3 S2 PebA FOR 27.39697 27.39697
    B4 S4 PebA FOR 36.99042 36.99042
    B5 S6 PebA FOR 31.15202 31.15202
    B6 S7 PebA FOR 28.16815 28.16815
    B7 MOCK PebA FOR Undetermined
    B8 HTC PebA FOR 21.80263 21.80263

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,364
    you DONT read it line by line,
    you import it all at once with
    docmd.TRANSFERSPREADSHEET
    or
    link the excel file as a table then run an append query to import all records.

  3. #3
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2013 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Or save it as a csv/text file, then you can read it line by line.

  4. #4
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,364
    reading line by line is 1000 times slower.

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

Similar Threads

  1. problem reading table from VB code
    By nello87to in forum Modules
    Replies: 3
    Last Post: 08-16-2016, 01:59 PM
  2. Access Reading File Path Incorrectly "..\.."
    By tdoolittle in forum Programming
    Replies: 5
    Last Post: 10-01-2014, 02:53 PM
  3. Reading Excel file from Share point
    By selvakumar.arc in forum Import/Export Data
    Replies: 1
    Last Post: 03-27-2014, 02:00 PM
  4. need help with reading code in downloaded file
    By ringnalda506 in forum Access
    Replies: 2
    Last Post: 12-03-2013, 11:32 AM
  5. Reading VBA code
    By ksammie01 in forum Access
    Replies: 11
    Last Post: 01-11-2013, 03:40 PM

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