Results 1 to 2 of 2

Macro to mimic Import & Link Excel button on external data

  1. #1
    arnstrb is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Mar 2014
    Posts
    1

    Thumbs up Macro to mimic Import & Link Excel button on external data

    I have a DB with multiple tables that have the data imported into them from Excel spreadsheets.
    I would like to have a Macro available to mimic the "Select Source and Destination of the Data" popup
    that results when one hits the Excel button under the External Data Section.

    I have not written any vba code before. I know that the resultant vba from using the ImportExcelSpreadsheet option is shown below.


    So What I really need to do is to replace the "","" with calls to subroutine that request the Table Name of the table to import into, and the File Name to import from. Any help would be appreciated. Thanks, Arnie

    Function Macro1()
    On Error GoTo Macro1_Err

    DoCmd.TransferSpreadsheet acImport, 10, "", "", True, ""


    Macro1_Exit:
    Exit Function

    Macro1_Err:
    MsgBox Error$
    Resume Macro1_Exit

    End Function

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    48,400
    Options:

    1. input the parameters to controls on a form and reference the controls

    2. InputBox popups in place of the ""
    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.

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

Similar Threads

  1. Import Excel File using a Macro
    By smakkiee in forum Access
    Replies: 6
    Last Post: 04-28-2014, 08:45 AM
  2. External Data Import from FTP
    By Flashbond in forum Access
    Replies: 1
    Last Post: 07-29-2013, 11:36 AM
  3. Replies: 2
    Last Post: 12-26-2012, 02:58 PM
  4. Excel Import Macro Help in Access
    By vennies83 in forum Import/Export Data
    Replies: 5
    Last Post: 11-02-2011, 09:24 AM
  5. Get External Data Macro
    By Harley Guy in forum Access
    Replies: 2
    Last Post: 11-16-2010, 12:20 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
  •  
Tech Forums: Microsoft Office Forums