PDA

View Full Version : Sleeper: FileCopy not helping



lynnnow
03-12-2005, 12:12 PM
Hi,

This is the code i've used.


Sub temp()
With Application.FileSearch
.NewSearch
.LookIn = "C:\Today's Work\1 Submitted"
.FileType = msoFileTypeAllFiles
.FileName = ActiveCell.Value
.Execute
If .FoundFiles.Count > 0 Then
SourceFolder = "C:\Today's Work\1 Submitted\" & .FileName & ".dss"
DestinationFolder = "C:\Today's Work\2 Assigned\" & ComboBox1.Value & "\"
FileCopy SourceFolder, DestinationFolder
Else
MsgBox "File not found"
End If
End With
End Sub


The FileCopy function doesn't work here. It shows me a Path Not Found error. This folder is very much present on the drive and the path is true, but still it shows this error.

Any help is appreciated.

Thanks

Lynnnow

mdmackillop
03-12-2005, 01:53 PM
Try the following. I've renamed the variables to avoid confusion


Source = "C:\Today's Work\1 Submitted\" & .Filename & ".dss"
Destination = "C:\Today's Work\2 Assigned\" & ComboBox1.Value & "\" & .Filename & ".dss"
FileCopy Source, Destination