View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Delete a file from Excel Application

You don't need to open excel to do this.

Kill "C:\Myfolder\MyFile.xls"

should do the job

--
Regards.
Tom Ogilvy

"Mark" wrote in message
...
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