Excel 2007 msoFileDialogSaveAs force ext
Is there a way to force an extension (e.g. *.xlsm) on the dialog box when using msoFileDialogSaveAs? Thanks.
[109 byte] By [
doasidont] at [2007-12-5 11:57:21]

# 2 Re: Excel 2007 msoFileDialogSaveAs force ext
That just presets the filter as the user can select any index from the dropdown. You may need to do a check after they make a selection.
# 3 Re: Excel 2007 msoFileDialogSaveAs force ext
Thanks. So I guess there is no way to force the extension? Can you tell me how I would check afterwards as you suggest? Also, is there a way to save the file as 'read only' (not just recommend open as read only).
# 4 Re: Excel 2007 msoFileDialogSaveAs force ext
Yes, change the dialog type to filepicker and then you can clear out all the filters and add just the one(s) you want.
Dim oDlg As FileDialog
Set oDlg = Application.FileDialog(msoFileDialogFilePicker)
oDlg.Filters.Clear
oDlg.Filters.Add "Excel Macro Enabled Workbooks Only (*.xlsm)", "*.xlsm"
oDlg.FilterIndex = 0
oDlg.Title = "RobDog888's Dialog Filter Demo"
oDlg.Show