I have the following code -- it gives an error and debugs on the "Set dlgSave = Applica..." with a runtime error of 445 "Object doesn't support this action"
Help says to set it like this:
But this also gives an error: "Name argument not found"
Here's the code:
Trevor
Help says to set it like this:
Code:
Set dlgSaveAs = Application.FileDialog( _
FileDialogType:=msoFileDialogSaveAs)
But this also gives an error: "Name argument not found"
Here's the code:
Code:
Public Function getNewFile() As String
Dim dlgSave As FileDialog
Set dlgSave = Application.FileDialog(msoFileDialogSaveAs)
With dlgSave
With .Filters
.Clear
.Add "Text Files", "*.txt; *.txt", 1
.Add "All files", "*.*", 2
End With
.FilterIndex = 1
.AllowMultiSelect = False
.Title = "Export File"
.ButtonName = "Ok"
.Show
If .SelectedItems.count > 0 Then
getNewFile = .SelectedItems(1)
End If
End With
Set dlgSave = Nothing
End Function
Trevor