GooberTron
Board Regular
- Joined
- Oct 13, 2012
- Messages
- 218
On Excel 2010 (and 2013) I am having a problem using the Step Into F8 debugging option. After I have selected the folder from the dialog it just seems to stop. Whether I debug from a calling sub or just this sub the same thing happens. Essentially it just stops after the .Show (and after I have used the dialog). Is this a known problem with debugging with dialogs? I found a few related things via Google and on here but nothing concrete. I have added a breakpoint on the next line which seems to be o.k. as a workaround but not ideal.
Code:
Dim FolderPath as String 'module level variable used in other subs
Sub GetFolder()
With Application.FileDialog(msoFileDialogFolderPicker)
.Title = "Select folder where sheets reside"
.AllowMultiSelect = False
.Show
If .SelectedItems.Count = 0 Then
Else
FolderPath = .SelectedItems(1) & "\"
End If
End With
End Sub