The FileSystemObject VBA DeleteFile functions deletes a specified file or files.
VBA DeleteFile Syntax
fso.DeleteFile( filename, [ force ] )
The location names of file(s) to delete. You can use wildcards such as *.* to specify more than a single file matching the pattern.
Optional. If True only read-only files are deleted. If False any files are deleted. False is default.
VBA DeleteFile Examples
Set fso = CreateObject("Scripting.FileSystemObject")
'Delete file Hello.xlsx
'Delete all files with XLSX extension in C:\Src folder
'Delete all files in specified folder
'Delete all files in subfolders of C:\Src