+ Reply to Thread
Results 1 to 2 of 2

File Copy Error

  1. #1
    Jay
    Guest

    File Copy Error

    I have copied this file from office excel help and ran it with error message
    as follows. Run time error: '53' File Not Found
    My deault folder address is My Documents and SRCFILE is under this directory.
    Thank you for your advices .

    Sub FileCopyTest()
    Dim SourceFile, DestinationFile
    SourceFile = "SRCFILE" ' Define source file name.
    DestinationFile = "DESTFILE" ' Define target file name.
    FileCopy SourceFile, DestinationFile ' Copy source to target
    End Sub

  2. #2
    Rowan Drummond
    Guest

    Re: File Copy Error

    Try adding the file extensions:

    Sub Cpy()
    Dim SourceFile As String
    Dim DestinationFile As String
    SourceFile = "SRCFILE.xls" ' Define source file name.
    DestinationFile = "DESTFILE.xls" ' Define target file name.
    FileCopy SourceFile, DestinationFile ' Copy source to target.
    End Sub

    Hope this helps
    Rowan

    Jay wrote:
    > I have copied this file from office excel help and ran it with error message
    > as follows. Run time error: '53' File Not Found
    > My deault folder address is My Documents and SRCFILE is under this directory.
    > Thank you for your advices .
    >
    > Sub FileCopyTest()
    > Dim SourceFile, DestinationFile
    > SourceFile = "SRCFILE" ' Define source file name.
    > DestinationFile = "DESTFILE" ' Define target file name.
    > FileCopy SourceFile, DestinationFile ' Copy source to target
    > End Sub


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1