Test if "FileCopy" function fails

  • Thread starter Thread starter Robert Crandal
  • Start date Start date
R

Robert Crandal

I am using the following line to copy a file:

FileCopy file1, file2

How can I test if the above function call fails
or not?? I tried using the following code below,
but I received a compiler error:

Set fc = FileCopy file1, file2

if fc is Nothing then
' it failed
else
' it worked
end if


Thank you!
 
Hi

Test if file2 exists, alternatively also if its filesize is identical to
file1.

HTH. Best wishes Harald
 
Back
Top