G
Guest
to all,
i have this error when i ran the code:
"Permission denied."
and this is my code:
'-------------------------------
Private Sub cmd_upload_Click()
Dim fso As New FileSystemObject
Dim fldr As Folder
Set fldr = fso.CreateFolder(ditination & workweek)
'With fso
Set fs = Application.FileSearch
'If Me.sourcefolder = 1 Then
With fs
If .Execute(SortBy:=msoSortbyFileName, _
SortOrder:=msoSortOrderAscending) <> "" Then
For i = 1 To .foundfiles.Count
fn = .foundfiles(i)
MsgBox distination & workweek
'fso.CopyFile fn, distination & workweek
fso.MoveFile fn, fldr
Next i
Me.totalfiles = .foundfiles.Count
Else
MsgBox "No Text Files found in specific drive.", vbInformation,
"Resti"
End If
End With
Set fldr = Nothing
Set fso = Nothing
End Sub
i need your help guys.
resti
i have this error when i ran the code:
"Permission denied."
and this is my code:
'-------------------------------
Private Sub cmd_upload_Click()
Dim fso As New FileSystemObject
Dim fldr As Folder
Set fldr = fso.CreateFolder(ditination & workweek)
'With fso
Set fs = Application.FileSearch
'If Me.sourcefolder = 1 Then
With fs
If .Execute(SortBy:=msoSortbyFileName, _
SortOrder:=msoSortOrderAscending) <> "" Then
For i = 1 To .foundfiles.Count
fn = .foundfiles(i)
MsgBox distination & workweek
'fso.CopyFile fn, distination & workweek
fso.MoveFile fn, fldr
Next i
Me.totalfiles = .foundfiles.Count
Else
MsgBox "No Text Files found in specific drive.", vbInformation,
"Resti"
End If
End With
Set fldr = Nothing
Set fso = Nothing
End Sub
i need your help guys.
resti