If True = DialogResult.Cancel Then MsgBox("Cancel Button Clicked") Else strFileName = OpenFD.FileName MsgBox(strFileName) End If