• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 260
  • Last Modified:

excel extensions

File pen dialogue box:
------------------------
Sub Get_Data()
FileToOpen = Application.GetOpenFilename _
(Title:="Please choose a file to import", _
FileFilter:="Excel Files *.xls (*.xls), *.* (*.*), *.xml (*.xml),")
''
If FileToOpen = False Then
MsgBox "No file specified.", vbExclamation, "Duh!!!"
Exit Sub
Else
Workbooks.Open Filename:=FileToOpen
End If
End Sub
----------------------------

The above code is working (except for the *.*) but I need to add the following extensions:
*.*, *.xlsx, *.xlsm

When I add them they do not appear in the open dialogue
All that appears at the moment are  the xls and xlm
0
doctorbill
Asked:
doctorbill
  • 2
1 Solution
 
KimputerCommented:
For ease of use, I grouped all Excel files together:

FileFilter:="Excel Files, *.xls;*.xlsx;*.xlsm,All files,*.*, XML files,*.xml")

Open in new window


And NOT grouped:

FileFilter:="Excel Files,*.xls,Excel new,*.xlsx,Excel Macro,*.xlsm,All files ,*.*,XML files,*.xml")

Open in new window

0
 
doctorbillAuthor Commented:
Perfect - thanks
0
 
doctorbillAuthor Commented:
solved
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now