Click to See Complete Forum and Search --> : CopyFile API function


alexK
November 4th, 1999, 07:58 AM
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!

Lothar Haensler
November 4th, 1999, 08:02 AM
vb has a Filecopy function
FileCopy source, target

alexK
November 4th, 1999, 08:21 AM
As I understand FileCopy is going to generate an
error if it is unsuccessful?
Thnks!

Lothar Haensler
November 4th, 1999, 08:23 AM
yes, it does.
Trap the error via On Error...