Forum Discussion
Nemmi69
Jan 19, 2026Copper Contributor
msoFileDialogFolderPicker compiler error
I have searched the net and not seen this issue.
I developed a stand alone program in Excel Vba using msoFileDialogFolderPicker. It runs no problem. The function is as follows:
Function PickFolder() As String
With Application.FileDialog(msoFileDialogFolderPicker)
If .Show = -1 Then PickFolder = .SelectedItems(1)
End With
End FunctionThis was then added to a larger program with exactly the same code on the same PC and I get 'compile error' variable not found with 'msoFileDialogFolderPicker' highlighted.
1 Reply
- JKPieterseSilver Contributor
Click Tools, References and make sure these are checked (at least these):