Solved

excel extensions

Posted on 2014-04-10
3
213 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
  • 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

830 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