Results 1 to 4 of 4
  1. #1
    willb006 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2015
    Posts
    2

    How do I have access ask me what spreadsheet I want to import, not have it hard coded.


    Hello,

    I am fairly new to importing data to Access and discovered a Macro option that is 'ImportExportSpreadsheet'. When I use this option it asks me to put a file name but I want it to ask me for the file name when I run the macro. Is this possible and if so how can I do it?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Isn't "asks me to put a file name" the same as "ask me for the file name"?

    Exactly what is the macro doing - opening import wizard?

    I don't use macros. VBA could use FileDialog and you can navigate to file. https://msdn.microsoft.com/en-us/lib.../ff836226.aspx
    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.

  3. #3
    willb006 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2015
    Posts
    2
    June7,

    To clarify the macro is importing an Excel Spreadsheet and appending to a table. In the macro wizard there is a place to hard code the file name. I would like the macro to open a browser window so I can go and select the file I would like to import. I appreciate the advice.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    I don't think macro can invoke the FileDialog except maybe by calling a VBA custom function that opens the FileDialog.

    I suppose macro can invoke an InputBox. But this would require use to type out the full path and be prone to user entry error.

    Better learn VBA.
    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. Replies: 3
    Last Post: 06-25-2015, 12:22 PM
  2. Can not import any excel 2010 spreadsheet into access 2010
    By BobsWright in forum Import/Export Data
    Replies: 4
    Last Post: 09-26-2013, 12:44 PM
  3. How to import excel spreadsheet into an Access subform
    By upfish in forum Import/Export Data
    Replies: 1
    Last Post: 10-03-2012, 01:53 PM
  4. Access 2010 Import Spreadsheet Wizard
    By frdebelo in forum Access
    Replies: 1
    Last Post: 06-20-2011, 12:11 PM
  5. import an excell spreadsheet in an access database
    By lmichaud in forum Import/Export Data
    Replies: 0
    Last Post: 11-03-2006, 08:29 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