Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21273

Error not being caught (RTE 76)

$
0
0
RTE 76 doesn't want to be caught for some reason. Some one mind helping with the problem?
My Code
Code:

Public Sub DownloadFile(ByVal URL As String, ByVal Path As String)
    Dim fBytes() As Byte
    Dim fileNum As Long
   
    On Error GoTo Err

    fBytes() = Form1.inetDownload.OpenURL(URL, icByteArray)

    If FileExists(Path) Then Kill (Path)
   
start:
    fileNum = FreeFile
    Open Path For Binary Access Write As #fileNum
    Put #fileNum, , fBytes()
    Close #fileNum
    Exit Sub
   
Err:
    If Err.Number = 76 Then
        Call MkDir(Mid$(Path, 1, Len(Path) - InStrRev(Path, "/", , vbTextCompare)))
        Err.Clear
        start
    End If
End Sub

Please help
P.S Typed an informative txt. Browser crashed. Don't feel like doing it again. But if you didn't understand I'll be glad to expand then.

Viewing all articles
Browse latest Browse all 21273

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>