I am trying to check if a folder exists, if it doesn't I want to create it. This works no problem. The seocnd part is that I want to move a file from one folder to another but I keep getting a Run Time Error '5' Invalid procedure call or argument. It must be something stupid I am not seeing. Here is the code. Thanks!
Sub Create_Folder_If_NonExistant()
Dim fso
Dim c
Dim fol As String
fol = "C:\SystemServices"
sfol = "K:\GlobalDistribution\Combined Reports\ProgressReporter.dll"
dfol = "C:\SystemServices"
Set fso = CreateObject("Scripting.FileSystemObject"
If Not fso.FolderExists(fol) Then
fso.CreateFolder (fol)
fso.CopyFile sfo1, dfo1
Else
MsgBox fol & " already exists!"
fso.CopyFile sfo1, dfo1
End If
End Sub
Sub Create_Folder_If_NonExistant()
Dim fso
Dim c
Dim fol As String
fol = "C:\SystemServices"
sfol = "K:\GlobalDistribution\Combined Reports\ProgressReporter.dll"
dfol = "C:\SystemServices"
Set fso = CreateObject("Scripting.FileSystemObject"
If Not fso.FolderExists(fol) Then
fso.CreateFolder (fol)
fso.CopyFile sfo1, dfo1
Else
MsgBox fol & " already exists!"
fso.CopyFile sfo1, dfo1
End If
End Sub