Christian Specht avatar Christian Specht committed 34f0ae6

File_Delete

Comments (0)

Files changed (2)

 Most of the functions are named after (and do the same like) useful functions in .NET that I missed in VBA.  
 Here is a short summary of the available functions and what they do in a nutshell:
 
+- **`File_Delete`**  
+Deletes a file. If the file does not exist, nothing happens.
 - **`File_ReadAllLines`**  
 Reads a text file and returns a string array, each array item containing a line from the file.
 - **`File_ReadAllText`**  
 '# VBA Helpers
 '# A collection of useful VBA functions
 '#
-'# Version 20121109.172711
+'# Version 20121109.174956
 '# (the version number is just the current date/time)
 '#
 '# Copyright (c) 2012 Christian Specht
 
 '##########################################################################################################################################
 
+Public Sub File_Delete(ByVal path_vbah As String)
+    'Deletes a file. If the file does not exist, nothing happens.
+
+    If Dir(path_vbah) > "" Then
+        Kill path_vbah
+    End If
+
+End Sub
+
 Public Function File_ReadAllLines(ByVal path_vbah As String) As String()
     'Reads a text file and returns a string array, each array item containing a line from the file.
     
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.