+ Reply to Thread
Results 1 to 2 of 2

VBA help needed to locate the excel workbook then import data into a table

  1. #1
    Forum Contributor
    Join Date
    10-30-2011
    Location
    Doha
    MS-Off Ver
    MS office 365
    Posts
    701

    VBA help needed to locate the excel workbook then import data into a table

    Hi Folks,

    I have database contains an user form called “MainForm” and table called “JobList”. In the MainForm I have placed two buttons (named “Import Joblist” and “Refresh Joblist”) and one textbox (named “Text1”)
    Now I need a macro for “Import Joblist” button to locate the excel workbook then import records set into the table called “JobList” AND show the Folder Path and excel workbook name in the “Text1”. I have some existing code to locate the folder and excel workbook and show the folder path and file name in “Text1” - its working fine). But I don’t know how to write a code to import data from selected excel file.

    Now I need one more macro for “Refresh Joblist” button to locate a excel workbook based on “Text1” value folder path then import records set into the table “JobList”.

    I have attached the Database and excel workbook of what I am trying to accomplish.

    Thanks in advance,

    Joshi
    Attached Files Attached Files
    Cheers,

    Joshi
    Being with a winner makes you a winner

  2. #2
    Valued Forum Contributor ranman256's Avatar
    Join Date
    07-29-2012
    Location
    Kentucky
    MS-Off Ver
    Excel 2003
    Posts
    1,176

    Re: VBA help needed to locate the excel workbook then import data into a table

    I would save the excel file to the same file and folder everytime so the code loads the same name.
    to import an excel file

    DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel12, tbl, File, True

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Locate Data across multiple sheets in an Excel Workbook
    By Gorbs in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-27-2014, 10:46 AM
  2. [SOLVED] Excel Formula needed to locate multiple values in 1 spreadsheet
    By Cammyd in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-02-2014, 04:48 PM
  3. Help with VBA Excel - import fifth excel sheet in a workbook to access table
    By ewong in forum Access Programming / VBA / Macros
    Replies: 3
    Last Post: 09-10-2012, 01:20 PM
  4. Locate data range import
    By NJ_Dev in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-20-2009, 08:38 AM
  5. [SOLVED] how can i locate duplicate data in an excel data table?
    By neil in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-13-2005, 09:06 PM

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