Error Handling
Hi all
The following code copys a file to a floppy disk
If Response = vbYes Then
FileCopy "c:\temp\Test1.txt", "a:\data_" & Format(Now, "yyyy-mm-dd HhNn") & ".txt"
End If
if there is no floppy disk in drive the program fails, not got much knwledge of error handling, any ideas how to:
Copy file to floppy
error - no floppy
if no disk msg box insert disk
[418 byte] By [
mp_direct] at [2007-11-11 7:13:36]

# 1 Re: Error Handling
First, I think you have to assume that the floppy drive is either the A: or B: drive. The following can determine drive status:
http://www.freevbcode.com/ShowCode.asp?ID=70
As an option to FileCopy you may want to consider using the SHFileOperation API function calls to copy files:
http://vbnet.mvps.org/code/shell/shfileopadv.htm