Results 1 to 2 of 2
  1. #1
    orangeman2003 is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Nov 2013
    Posts
    21

    VBA code to open a file with a dynamically changing filename


    Hi,

    I have a command button that when clicked exports an Access table to an Excel spreadsheet but the filename is dynamic so it adds a string (currently 'Test') as well as the date the file was exported. Now I want to add code to open the file once the data has been exported. However, I am not sure what to do about the filename since it is dynamic and not static. I can't point VBA to a specific file since the file to open depends on the day the data was exported

    Thanks

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    You want to open the file immediately after the export? So you know the name of the Excel file that was just created because you just built that file name with the code that did the export?

    Review http://allenbrowne.com/func-GoHyperlink.html
    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: 15
    Last Post: 11-27-2013, 10:38 AM
  2. Changing a Table Link Dynamically
    By EddieN1 in forum Import/Export Data
    Replies: 3
    Last Post: 09-05-2013, 02:17 PM
  3. Replies: 2
    Last Post: 12-21-2012, 04:59 PM
  4. Replies: 1
    Last Post: 06-29-2011, 07:22 AM
  5. Linked Tables and changing filename
    By a2music in forum Database Design
    Replies: 1
    Last Post: 02-28-2011, 03:52 PM

Tags for this Thread

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