File System
Like to know how to do such things as delete file(s) and directory(s)? Even create directories etc?
Well, take a look what i'm about to write
Directory(s)
To create a directory, simply use this code;
VBA.FileSystem.MkDir "driveletter:\directoryname"
eg VBA.FileSystem.MkDir "C:\dogs"
simple huh?
Maybe u'd like to remove a specifyed directory?
VBA.FileSystem.RmDir "driveletter:\directoryname"
same type of method with the drive letter and dir name
just a note about this. To avoid errors with this, add the follow to the code;
On Error GoTo errLog
VBA.FileSystem.RmDir "c:\rabbits" ' This is an example say if it didn't exist so no need to add this :P
errLog:
If Err.Number = 76 Then
MsgBox "Directory doesn't exist"
End If
Time to use the On Error Goto statement. The example states on an error goto ErrLog
What this means if the error number = 76, simply mean if the directory doesn't exist, a msgbox will appear saying so.
adding more code soon, please be patient