How can I tell if they press "Cancel"?
Printable View
How can I tell if they press "Cancel"?
Set the CancelError property to true. Add Error handeling code and test if Err = cdlCancel.
Good luck!Code:On Error Resume Next
With CommonDialog1
.CancelError = True
.ShowOpen
If Err = cdlCancel Then
Exit Sub 'the user pressed Cancel so bail out
End If
'the user pressed OK
End With
set the CalcelEror poperty to true, then an error will raised if cancel is selected, set up an error trap to catch it.
Damn, i was beaten to it.
Wow, I've been here for a while and I've never seen you before Joacim.
Over 700 posts...