+ Reply to Thread
Results 1 to 4 of 4

Import many excel files to many tables in one access database

  1. #1
    Forum Contributor
    Join Date
    12-20-2012
    Location
    Qatar
    MS-Off Ver
    Excel 2010
    Posts
    171

    Import many excel files to many tables in one access database

    hi all,

    please i need your help; i want to import a lot of excel files to access, but i need each and every excel file to be imported in one table, excel file name = table name

    i mean for example; if i imported 10 excel files (file names: 1,2,3,4,5,6,7,8,9,10), the result will be 10 tables in access (table names: 1,2,3,4,5,6,7,8,9,10).

    i tried this one, but it is importing all files to one table which i don't want

    Please Login or Register  to view this content.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 VersionVersion 2501 Win 11
    Posts
    24,424

    Re: Import many excel files to many tables in one access database

    Take a look at Ken Snells web site. He offers several suggestions of code on importing to Access.
    http://www.accessmvp.com/kdsnell/EXCEL_Import.htm
    Alan
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: Import many excel files to many tables in one access database

    As discussed in the other thread, this is probably a really bad idea

  4. #4
    Forum Contributor
    Join Date
    12-20-2012
    Location
    Qatar
    MS-Off Ver
    Excel 2010
    Posts
    171

    Re: Import many excel files to many tables in one access database

    hi

    i checked the links and there are only the following methods;

    1- Import Data from All Worksheets in a single EXCEL File into Separate Tables via TransferSpreadsheet (VBA)

    2- Import Data from A Specific Worksheet in All EXCEL Files in a single Folder into Separate Tables via TransferSpreadsheet (VBA)

    3- Import Data from All Worksheets in All EXCEL Files in a single Folder into Separate Tables via TransferSpreadsheet (VBA)

    please note that i need same code like in second one of the above but without to select the sheet name, i need a code to select the first sheet in each files without mention the name of the sheet, just the first sheet in the excel files in the folder

    thanks

  5. #5
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: Import many excel files to many tables in one access database

    The problem is the third argument in the TransferSpreadsheet function. Change it from "Table Name" to myfile.
    Is your code running too slowly?
    Does your workbook or database have a bunch of duplicate pieces of data?
    Have a look at this article to learn the best ways to set up your projects.
    It will save both time and effort in the long run!


    Dave

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1