Solved

excel extensions

Posted on 2014-04-10
3
223 Views
Last Modified: 2014-04-10
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
Comment
Question by:doctorbill
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 35

Accepted Solution

by:
Kimputer earned 500 total points
ID: 39991608
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
 

Author Comment

by:doctorbill
ID: 39991617
Perfect - thanks
0
 

Author Closing Comment

by:doctorbill
ID: 39991621
solved
0

Featured Post

Independent Software Vendors: 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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question