View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Robert Crandal Robert Crandal is offline
external usenet poster
 
Posts: 309
Default Test if "FileCopy" function fails

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!