Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete Excel File- Possible?

Status
Not open for further replies.

RAxel

MIS
Sep 8, 2005
121
US
I'm using VBA to export a make-table query to excel, always to the same location (say C:\).

Before I export the table to excel, can I first delete the file that's already there (always the same name)? I thought I read somewhere about a 'Kill' statement but I haven't had any luck finding that code.

Thanks.
 
Something like this ?
strPath = "C:\path\to\workbook.xls"
If Dir(strPath) <> "" Then Kill strPath

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Can the excel file be automatically opened after exporting it from access?
 
if you are using OutputTo then set AutoStrat =True
Code:
DoCmd.OutputTo acOutputTable, "ObjectName", acFormatXLS, "C:\FileName.xls", [b]True[/b]


________________________________________________________
Zameer Abdulla
Help to find Missing people
There’s a world of difference between editorials and advertorials
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top