Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 989
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Downloading Excel file from SQL application janee Excel Discussion (Misc queries) 6 October 3rd 08 06:10 PM
opening a file in Excel starts application but dose not open file Bob Shelton Excel Discussion (Misc queries) 1 July 2nd 08 07:51 PM
My file is not opening within my excel application? Roachie Excel Discussion (Misc queries) 1 August 30th 06 03:59 AM
Can Excel open a new application for every file opened? shoon Excel Discussion (Misc queries) 1 December 13th 05 04:43 PM
Delete rows from outside of Excel application dar Excel Programming 3 December 29th 04 04:21 PM


All times are GMT +1. The time now is 11:36 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"