Consulting

Results 1 to 2 of 2

Thread: Sleeper: FileCopy not helping

  1. #1
    VBAX Tutor lynnnow's Avatar
    Joined
    Jan 2005
    Location
    Mumbai, Maharashtra, India
    Posts
    299
    Location

    Sleeper: FileCopy not helping

    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

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •