Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Filter only shortcuts and xl files

Try

Dim WB As Workbook
Dim FName As String
With Application.FileDialog(msoFileDialogOpen)
.Filters.Clear
.Filters.Add "Excel Files", "*.xls", 1
.FilterIndex = 1
.InitialFileName = "%UserProfile%\My Documents"
.AllowMultiSelect = False
If Not .Show Then Exit Sub
FName = .SelectedItems(1)
End With


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)

"Steven" wrote in message
...
I have the following code:

Private Sub OpenMyDocuments()
On Error GoTo ErrMacro

Dim FName As String
With Application.FileDialog(msoFileDialogOpen)
.InitialFileName = "%UserProfile%\My Documents"
.AllowMultiSelect = False
If Not .Show Then Exit Sub
FName = .SelectedItems(1)
End With

If Len(FName) 0 Then
Set wb = Workbooks.Open(FName)
End If

Application.RecentFiles.Add Name:=FName

Windows("Notes.xls").Close (0)

ErrMacro:

End Sub

It shows - All Files (*.*) - in the Files of Type field. How do I make
it
default to - All Microsoft Office Excel Files - ?

Thank you for your help.

Steven



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel files on USB -- taskbar shortcuts don't work Xr8y Excel Discussion (Misc queries) 0 January 16th 11 08:45 PM
How to remove listed shortcuts for deleted Excel files? Dave Excel Discussion (Misc queries) 1 August 11th 08 01:06 AM
all my shortcuts to excel files open up as a picture Gimbee Excel Discussion (Misc queries) 0 April 13th 08 12:39 AM
How to disable the shortcuts of excel files created by MSExcel 20. Nikhil Excel Discussion (Misc queries) 1 February 19th 05 12:40 PM
shortcuts to excel files. nitm Excel Programming 11 February 14th 05 05:37 PM


All times are GMT +1. The time now is 04:58 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"