Test if "FileCopy" function fails

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!
 
H

Harald Staff

Hi

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

HTH. Best wishes Harald
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top