I have searched this topic many times, and I have tried a lot. In fact, I need to ask the user to save as a user type that is not available in msoFileDialogSaveAs filters.
I know that I can save, say, *.txt , and then change the extension before saving. I did this, and it worked, but when the user enters the file name into a folder that already contains other files of a custom type, the user will not see a list of existing user files, because the active filter is not of this type.
So I was wondering if it is possible to use msoFileDialogFilePicker to save as a custom type by entering the file name.
Here's what it might look like:
Function userFileSaveDialog_OneFilterOnly(iFilter As String, _ iExtension As String, _ Optional iTitle As String) With Application.FileDialog(msoFileDialogFilePicker) '(msoFileDialogSaveAs) .Filters.Clear .Filters.Add iFilter, iExtension .AllowMultiSelect=False .ButtonName "Save" .Title = iTitle If CBool(.Show) Then userFileSaveDialog_OneFilterOnly = .SelectedItems(.SelectedItems.Count) Else End If End With End Function
Thanks for the help!
excel-vba excel
simpLE MAn
source share