VBA opens a file by file type name

Source: Internet
Author: User

Application.getopenfilename (FileFilter, FileIndex, Fileselecttitle, button, False)

FileFilter: Specifies the type of file that can be selected

Example: "csv file (*.csv), *.csv, All Files (*. *), *. *"

One thing to note here is that if there are n pairs, the return value of the program is an array when n>1, and if n=1, the return value is a string.

FileIndex: Specifies the default file type,

Example: 2 o'clock, then all file types are default values

Fileselecttitle: Specifies the title of the popup's File selection box

Button: It's said to be for Mac, no matter ....

The last value that specifies whether multiple selections are available, that is, you can select more than one file.

The return value of this program needs to be noted, if the file is selected, then there is no problem.

If you close the File Selection window without selecting a file, the return value is "False".

That's so damn weird!

VBA opens a file by file type name

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.