+ Reply to Thread
Results 1 to 2 of 2

disabling the Files type combo box

  1. #1
    Registered User
    Join Date
    10-19-2005
    Posts
    38

    Smile disabling the Files type combo box

    Hi All,


    My Visual Basic application is using Excel for reporting.

    I need to restrict the users of my application to open only excel files from
    the File->Open dialogue box.

    Or

    Is there any way to make default ‘Excel files (*.xls)’ in the Files type
    combo box in the Open dialog box and disabling the Files type combo box, so
    that the users can only select excel files when they click File->Open.


    Please help me in this regard

  2. #2
    Dave Peterson
    Guest

    Re: disabling the Files type combo box

    I still don't think so.

    Even if you force the dialog open with just *.xls types, the user can type:
    *.*
    in the filename and open whatever they want.

    But you could ask for the filename to open, then yell if the extension isn't
    ..xls.

    dim myFileName as variant
    myfilename = application.getopenfilename("Excel Files, *.xls")
    if myfilename = false then
    exit sub 'user hit cancel
    end if

    if lcase(right(myfilename,4)) <> ".xls" then
    msgbox "Nope--only .xls files can be opened!
    exit sub
    end if



    areddy wrote:
    >
    > Hi All,
    >
    > My Visual Basic application is using Excel for reporting.
    >
    > I need to restrict the users of my application to open only excel files
    > from
    > the File->Open dialogue box.
    >
    > Or
    >
    > Is there any way to make default ‘Excel files (*.xls)’ in the Files
    > type
    > combo box in the Open dialog box and disabling the Files type combo
    > box, so
    > that the users can only select excel files when they click File->Open.
    >
    > Please help me in this regard
    >
    > --
    > areddy
    > ------------------------------------------------------------------------
    > areddy's Profile: http://www.excelforum.com/member.php...o&userid=28204
    > View this thread: http://www.excelforum.com/showthread...hreadid=477439


    --

    Dave Peterson

+ Reply to Thread

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