CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 1999
    Location
    US
    Posts
    34

    CopyFile API function

    CopyFile function fail if I use True for the
    last parameter. The file that I try to overwrite
    is a .xls file and is not write protected.

    CopyFile(sSourcePath, sDestination, false)



    Is there a beter way to copy a file?
    Is there any VB functions?
    thks!
    Alex!


  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: CopyFile API function

    vb has a Filecopy function
    FileCopy source, target


  3. #3
    Join Date
    Oct 1999
    Location
    US
    Posts
    34

    Re: CopyFile API function

    As I understand FileCopy is going to generate an
    error if it is unsuccessful?
    Thnks!


  4. #4
    Join Date
    May 1999
    Posts
    3,332

    Re: CopyFile API function

    yes, it does.
    Trap the error via On Error...


Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured