Re: Check if a drive exists
There are various ways to avoid or handle that error.
Given the circumstances, I suspect you would like to show the same MsgBox if the drive does not exist, in which case you can use a simple method:
Code:
On Error Resume Next
If txtGradeObs.Text = "" Or Dir(txtGradeObs.Text) = "" Then
MsgBox("Specify the Grade job of Obstructions", vbExclamation, MsgBoxTitle)
Exit Sub
End If
On Error GoTo 0 '(or if you had a different "on error" line before, repeat it here)
This will cause the MsgBox to show (and the Exit Sub) if either of the conditions are true, or any error occurs during the Dir.