Share via


File '<filename>' cannot be deleted because it is open

A deletion is being attempted on an open file.

To correct this error

  • Close the file before deleting it.

See Also

Reference

FileClose Function

My.Computer.FileSystem.DeleteFile Method

My.Computer.FileSystem Object