Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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!




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 449
Default Test if "FileCopy" function fails

Hi

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

HTH. Best wishes Harald

"Robert Crandal" wrote in message
...
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!





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
method "range" of object "_worksheet" fails PBcorn Excel Programming 5 October 27th 08 04:33 PM
Can I create an "IF" function using cell color as a logical test? JessLynn Excel Worksheet Functions 1 June 25th 08 08:09 PM
Complex if test program possible? If "value" "value", paste "value" in another cell? jseabold Excel Discussion (Misc queries) 1 January 30th 06 10:01 PM
FileCopy Command Giving "Subscript Out of Range" Error Message Jim Hagan Excel Programming 2 June 15th 05 06:07 PM
Looking for VB code to test for "RING" , "BUSY" disconnects or other signals BruceJ[_2_] Excel Programming 3 November 20th 03 01:55 AM


All times are GMT +1. The time now is 10:39 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"