kellyputty
Technical User
The following code always ends in a runtime error instead of being handled by the On Error statement. Any idea what I am doing wrong?
<code>
Private Sub cmdOpenFile_Click()
On Error GoTo HandleErrors
Open txtPathName.Text For Input As #1
Dim S As String
Input #1, S
cmdOpenFile_Click_Exit:
Exit Sub
HandleErrors:
Select Case Err.Number
Case 53
MsgBox "File not found."
Case 71
MsgBox "Disk not Ready."
Case 76
MsgBox "Path not found."
Case Else
Err.Raise Err
End Select
Resume
End Sub
</code>
Thanks in advance,
kellyputty
<code>
Private Sub cmdOpenFile_Click()
On Error GoTo HandleErrors
Open txtPathName.Text For Input As #1
Dim S As String
Input #1, S
cmdOpenFile_Click_Exit:
Exit Sub
HandleErrors:
Select Case Err.Number
Case 53
MsgBox "File not found."
Case 71
MsgBox "Disk not Ready."
Case 76
MsgBox "Path not found."
Case Else
Err.Raise Err
End Select
Resume
End Sub
</code>
Thanks in advance,
kellyputty