Hi,
I am using Jmacp's Asynchronous download User Control to download files of over 500MB. However, I noticed that I receive a number of errors, one of which is "Run-Time Error 55 - File already open" I have managed to track download the part of the code causing the problem, although, I have no idea how to fix it?
As you can see it just jumps straight to the "errHandler".
Nightwalker
I am using Jmacp's Asynchronous download User Control to download files of over 500MB. However, I noticed that I receive a number of errors, one of which is "Run-Time Error 55 - File already open" I have managed to track download the part of the code causing the problem, although, I have no idea how to fix it?
vb Code:
Private Sub UserControl_AsyncReadComplete(AsyncProp As AsyncProperty) Dim intFile As Integer Dim bBytes() As Byte intFile = FreeFile() Open App.Path & "\Error.Log" For Append As #ff On Error GoTo errHandler Select Case AsyncProp.PropertyName Case "file" Open App.Path & "\" & strFilename For Binary As #intFile Print #ff, "Before Bytes" bBytes = AsyncProp.Value Put #1, , bBytes Close #intFile txtDest.Text = "File saved to " & App.Path & "\" & strFilename Print #ff, "After File saved to" cmdFile.Enabled = True End Select lblProgress.Visible = False lblPercent.Caption = "0%" Close #ff Exit Sub errHandler: MsgBox Err.Number & " " & Err.Description End Sub
As you can see it just jumps straight to the "errHandler".
Nightwalker