Results 1 to 7 of 7
  1. #1
    johnseito is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    419

    read excel file into ACCESS table, field by field and line by line instead of importing it.

    Is there a way to use VBA to read excel file (excel sheet) into an Access Database table, field by field, line by line, row by row.



    I want to do it this way instead of importing it because I want to control it by reading the file into an Access Table.

  2. #2
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Create a link to the Excel spreadsheet (External data - Import and Link). The linked spreadsheet can then be used in the same way as a table in VBA, e.g. in a recordset, except that it cannot be updated.

  3. #3
    johnseito is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    419
    I have a file with data in one form I want to covert the data into another form and into access table. I don't think link will work.

  4. #4
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    You can read a file line by line using "open". However, I believe it has to be a text/csv and it is far simpler to import the file to a temporary table and do all the data manipulation in Access. With import you will have visibility to the raw data without any of Excel's formatting.

  5. #5
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    I have a file with data in one form I want to covert the data into another form
    Please clarify that - your use of the word "form" is confusing. Do you mean you want to convert from one format to another format? If so, please tell us exactly what you need to do, and why you need to do it in Access.

  6. #6
    johnseito is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    419
    Yes you are correct from one format to another.
    Do it in Access to find the Grand total and sub total and wants to build an application to do it rather than manual.
    Needs to format so it can do the query to achieve the desire result instead of not formatting it.

  7. #7
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Another option is to use automation to open the Excel workbook and loop through the rows and columns (nested Do loops). (Code would be in Access)
    Example code is at Ken Snells site

    Obviously, you would have to modify the code to fit your requirements.......

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

Similar Threads

  1. Replies: 4
    Last Post: 08-22-2017, 07:14 PM
  2. Replies: 1
    Last Post: 01-16-2017, 07:50 PM
  3. Field F9 error when importing Excel file to existing table
    By dougdrex in forum Import/Export Data
    Replies: 2
    Last Post: 12-26-2014, 01:38 PM
  4. Replies: 10
    Last Post: 06-10-2014, 09:03 AM
  5. Replies: 1
    Last Post: 09-15-2012, 08:22 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