Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete a file from Excel Application
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Downloading Excel file from SQL application | Excel Discussion (Misc queries) | |||
opening a file in Excel starts application but dose not open file | Excel Discussion (Misc queries) | |||
My file is not opening within my excel application? | Excel Discussion (Misc queries) | |||
Can Excel open a new application for every file opened? | Excel Discussion (Misc queries) | |||
Delete rows from outside of Excel application | Excel Programming |