Results 1 to 4 of 4

GetOpenFilename

Threaded View

StevenM GetOpenFilename 03-20-2012, 12:53 PM
tigeravatar Re: How to Use... 03-20-2012, 01:19 PM
StevenM Re: GetOpenFilename 03-20-2012, 03:02 PM
tigeravatar Re: GetOpenFilename 03-20-2012, 03:25 PM
  1. #1
    Valued Forum Contributor StevenM's Avatar
    Join Date
    03-23-2008
    Location
    New Lenox, IL USA
    MS-Off Ver
    2007
    Posts
    910

    GetOpenFilename

        sFilters = "Excel Files (*.xlsx), *.xlsx"
        iFilterIndex = 1
        sTitle = "Select Excel File"
        
        ChDir ThisWorkbook.Path & "\"
        sFileName = Application.GetOpenFilename(FileFilter:=sFilters, _
            FilterIndex:=iFilterIndex, Title:=sTitle)
    The above code works, but I can't figure out how to get both *.xlsx files and/or *.xls files.

    I've tried: sFilters = "Excel Files (*.xls;*xlsx), *.xls;*.xlsx"
    But I get all files and not just Excel files.

    I've tried: sFilters = "Excel Files (*.xlsx), *.xlsx" & "Excel Files (*.xls), *.xls"
    But I get an error with that method.

    Any idea how I can get both *.xls & *.xlsx files?

    Any help will be greatly appreciated!

    Steven Craig Miller
    Last edited by StevenM; 03-20-2012 at 03:03 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1