Dir = Select Directory
Private Sub CommandButton1_Click()
Dim filename As String
filename = Dir("E:\sales")
End Sub
Curdir = Current Directory Path
Private Sub CommandButton1_Click()
Range("A1").Value = CurDir
MsgBox CurDir
End Sub
FileLen - - File Length
Private Sub CommandButton1_Click()
'denotes file length in bytes
MsgBox FileLen("E:\Sales.txt")
End Sub
MKDir - - Make Directory
Private Sub CommandButton1_Click()
MkDir ("F:\sales")
End Sub
Kill - Delete Files
Private Sub CommandButton1_Click()
Kill "F:\sales\*.txt"
End Sub
Private Sub CommandButton1_Click()
Dim source As String
source = "d:\abc"
MsgBox source & "\" & "*.txt"
Kill source & "\" & "*.txt"
End Sub
FiledateTime - Date of File Created\Last Modified
Private Sub CommandButton1_Click()
Dim j As String
j = CurDir
MsgBox FileDateTime(j)
End Sub
Chdir - Changes the Current Directory
Private Sub CommandButton1_Click()
ChDir "D:\sales"
End Sub
Chdrive - Changes the drive
Private Sub CommandButton1_Click()
ChDrive "F:"
End Sub
FileCopy - Copies from Source to Destination
Private Sub CommandButton1_Click()
FileCopy "E:\sales\abc.txt", "F:\sales\abc.txt"
End Sub
Kill - Delete a File from a source
Private Sub CommandButton1_Click()
Kill ("D:\sales.txt")
End Sub
RmDir - Remove Directory
Private Sub CommandButton1_Click()
RmDir "E:\Sales"
End Sub
GetOpen File Name Method
Private Sub CommandButton1_Click()
Dim openfile As String
openfile = Application.GetOpenFilename()
End Sub