View Single Post
 
Old 07-19-2014, 07:54 PM
smndnm smndnm is offline Windows 7 64bit Office 2010 64bit
Novice
 
Join Date: Jul 2014
Location: Queensland
Posts: 24
smndnm is on a distinguished road
Default Gracefully exiting the msoFileDialogFolderPicker

Hello,

This code currently does NOT exit gracefully when clicking cancel.

It causes a "Run time Error '5': invalid proedure call or argument."

I am thinking the problem occurs because there is no possible value to assign to 'Fldr', but then I also would have thought 'Exit Sub' meant Exit Sub now!!

Code:
 With Application.FileDialog(msoFileDialogFolderPicker)
    .InitialFileName = "G:\Admin - MASTER\Customers\"
    .AllowMultiSelect = False
    .Title = "Select Destination Folder for the SWMS"
    If .Show = -2 Then Exit Sub
    Fldr = .SelectedItems(1)
End With
any suggestions?

Regards from a brisk Queensland
Reply With Quote