Multiple FileFilters in GetOpenFilename

ChrisBM

Board Regular
Joined
Sep 22, 2014
Messages
215
Trying to use a dialog box to prompt the user to locate the file. By default I would like the file filter to be the expected file type (.xlsx) but I want the user to be able to browse for All Files. Struggling to get the formatting of FileFilter:= correct for multiple groups.

WORKING (with single file Filter)
Application.GetOpenFilename(FileFilter:="Microsoft Excel Files (*.xlsx), *.xlsx", FilterIndex:=1, MultiSelect:=False)

NOT WORKING (multiple file filters)
Application.GetOpenFilename(FileFilter:="Microsoft Excel Files (*.xlsx), *.xlsx" + "All Files (*.*), *.*", FilterIndex:=1, MultiSelect:=False)

Edit: Resolved
SOLUTION
Application.GetOpenFilename(FileFilter:="Microsoft Excel Files (*.xlsx; *.xls), (*.xlsx; *.xls), All Files, *.*", FilterIndex:=1)

Many Thanks,
Chris
 
Last edited:

Some videos you may like

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

Watch MrExcel Video

Forum statistics

Threads
1,109,048
Messages
5,526,477
Members
409,702
Latest member
thmoriarty

This Week's Hot Topics

Top