Results 1 to 4 of 4
  1. #1
    Join Date
    May 2004
    Posts
    133

    Unanswered: open dialogbox to select excel file to import to mdb

    i have this small code to import excel data into mdb file:
    DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, _
    "datapub", "D:\datapubcolumnar.xls", True, "datapubcolumnar!"

    But I want to improve by call a dialog box for user to choose excel file.
    Could anyone can write this code for me.
    Thanks in advance.

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by cuongvt
    Could anyone can write this code for me.
    No

    But I know a man who already has. Check out http://www.dbforums.com/showthread.php?t=1212896&page=2
    Download the zip and have a look at the code. The very first proc for the form calls a function in the module that opens a dialog box to select a file to import via docmd.TransferThingy


    HTH
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Apr 2006
    Posts
    4
    Make sure Tools/References has Microsoft Office listed, and then put these lines into the beginning of your sub:

    Dim strFileStuff As String
    strFileStuff = FileOpenDialog

    strFileStuff will then contain the entire path to the Excel (or other) file you want.

    HTH.

    Thomas F. Ewald
    FCS Database Manager
    General Dynamics Land Systems

  4. #4
    Join Date
    Apr 2006
    Posts
    4

    Open Dialog to accept Excel file

    Make sure Tools/References has Microsoft Office listed, and then put these lines into the beginning of your sub:

    Dim strFileStuff As String
    strFileStuff = FileOpenDialog

    strFileStuff will then contain the entire path to the Excel (or other) file you want.

    HTH.

    Thomas F. Ewald
    FCS Database Manager
    General Dynamics Land Systems

Posting Permissions

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