Delete a file from Excel Application

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

My code opens an Excel application (using CreateObject).

From within the Excel application, I'd like to write code to delete a file
(i.e., an Excel workbook) . What is the code to do this?

When I record the macro from the menu: file/open, right click highlighting
the file and left click delete, the file is deleted but the macro is blank.
And Delete does not seem to be a valid method of Workbook.

Any Ideas? Is there some reference that I need to set to allow file
manipulation from within Excel?

Thank you,
Mark
 
You don't need to open excel to do this.

Kill "C:\Myfolder\MyFile.xls"

should do the job
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top