Thread
: [Solved]
Stop macro if no file is selected in dialog box (when user presses cancel instead of selecting file)
View Single Post
08-11-2014, 01:30 PM
Cosmo
Windows Vista
Office 2007
Competent Performer
Join Date: Mar 2012
Posts: 240
If the user cancels, then .SelectedItems.Count will be 0.
If (.SelectedItems.Count > 0) Then
For j = 1 To .SelectedItems.Count
Documents.Add .SelectedItems(j)
Next
else
' Nothing selected.
Exit Sub
end if
Cosmo
View Public Profile
Find all posts by Cosmo