View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Mike Mike is offline
external usenet poster
 
Posts: 3,101
Default Filter The msoFileDialogOpen

for the life of me I forgot the add

Thanks Ossie

"OssieMac" wrote:

Hi Mike,

Try this.

Dim FD
Set FD = Application.FileDialog(msoFileDialogOpen)
With Application.FileDialog(msoFileDialogOpen)
.Filters.Clear
.Filters.Add "Excel files", "*.*"

'or
'.Filters.Add "All files", "*.xls"

.AllowMultiSelect = False
.InitialFileName = "C:\"
.Title = "(Open excel file)"

If .Show = True Then
.Execute
Else
Exit Sub

End If
End With

--
Regards,

OssieMac


"Mike" wrote:

Ive tried to filter this msoFileDialogOpen to only allow excel files to be
selected but cant get it to work. Any help ?
Set FD = Application.FileDialog(msoFileDialogOpen)
With Application.FileDialog(msoFileDialogOpen)
.AllowMultiSelect = False
.InitialFileName = "C:\"
.Title = "(Open excel file)"

If .Show = True Then
.Execute
Else
Exit Sub

End If
End With