Link to home
Start Free TrialLog in
Avatar of jmcclosk
jmcclosk

asked on

Using Microsoft Access 2003 VBA Code to delete an Excel Workbook

I have a button on a form in my DB that creates an Excel Spreadsheet to display data to the end user. It saves this Excel file on the local hard drive in a specific location. After the user closes it, the data is no longer useful.  Before the user runs the next instance of this, I would like Access to delete the previous Excel file before creating the new one.

The path and file name are always a constant, so they can be specified on the script.  For specific reasons, I do not want the script to just overwrite the previous file the next time the user runs it.  I need to have it deleted.  Is there VBA Code I can add at the beginning of my script to delete the file first?  
ASKER CERTIFIED SOLUTION
Avatar of jppinto
jppinto
Flag of Portugal image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jmcclosk
jmcclosk

ASKER

Thank you!