FILE.DELETE macro

Deletes a file from the disk. Although you will normally delete files manually, you can, for example, use FILE.DELETE in a macro to delete temporary files created by the macro.

Syntax

FILE.DELETE(file_text)

FILE.DELETE?(file_text)

File_text    is the name of the file to delete.

Remarks

 

Examples

In Microsoft Excel for Windows, the following macro formula deletes a file called CHART1.XLS from the current directory:

FILE.DELETE("CHART1.XLS")

The following macro formula deletes a file called 92INFO.XLS kept in the EXCEL\SALES subdirectory:

FILE.DELETE("C:\EXCEL\SALES\92INFO.XLS")

The following macro formula displays the Delete dialog box listing all documents whose extensions begin with the letters "XL":

FILE.DELETE?("*.XL?")

In Microsoft Excel for the Macintosh, the following macro formula deletes a file called CHART1 from the current folder:

FILE.DELETE("CHART1")

The following macro formula deletes a file called 1992 INFO kept in a series of nested folders:

FILE.DELETE("HARD DISK:EXCEL 5:SALES WORKSHEETS:1992 INFO")

The following macro formula displays the Delete dialog box listing all documents beginning with the word "Clients":

FILE.DELETE?("Clients*")

Related Functions

FILE.CLOSE   Closes the active workbook

FILES   Returns the filenames in the specified directory or folder

Return to index