+ Reply to Thread
Results 1 to 8 of 8

GetOpenFileName method different in Excel

  1. #1

    GetOpenFileName method different in Excel

    In Excel 2000, using the GetOpenFileName method you can include a FileFilter
    (the first argument) such as *.something.extension and the dialog box would
    show those files.

    Starting in Excel XP that does not work in code anymore. You can physically
    type that into the dialog box under "File name" and it will work but when it
    is set in code it will only recognize *.extension.

    Is this a design change or a bug?

    Sample code:
    ----------------
    FileName = Application.GetOpenFilename("Sample Files (*.test.txt),
    *.test.txt")
    ----------------
    This will not show a file named First.test.txt in Excel XP/2003 but the same
    code will show the file in Excel 2000.

    Ryan


  2. #2
    Tom Ogilvy
    Guest

    Re: GetOpenFileName method different in Excel

    GetOpenFilename has always only supported filtering on an extension. In
    your case, the extension is .txt. If you were able to get it to filter
    ..test.txt, then you were fortunate, but that isn't the advertised behavior -
    so you were utilizing an undocumented capability. You use undocumented
    capabilities at your own risk since they may not be supported in later
    versions.

    --
    Regards,
    Tom Ogilvy

    <[email protected]> wrote in message
    news:[email protected]...
    > In Excel 2000, using the GetOpenFileName method you can include a

    FileFilter
    > (the first argument) such as *.something.extension and the dialog box

    would
    > show those files.
    >
    > Starting in Excel XP that does not work in code anymore. You can

    physically
    > type that into the dialog box under "File name" and it will work but when

    it
    > is set in code it will only recognize *.extension.
    >
    > Is this a design change or a bug?
    >
    > Sample code:
    > ----------------
    > FileName = Application.GetOpenFilename("Sample Files (*.test.txt),
    > *.test.txt")
    > ----------------
    > This will not show a file named First.test.txt in Excel XP/2003 but the

    same
    > code will show the file in Excel 2000.
    >
    > Ryan
    >




  3. #3

    Re: GetOpenFileName method different in Excel

    The first paramater to GetOpenFileName in Excel is called FileFilter not
    extension. In fact in Excel 2003 Help on GetOpenFileName for FileFilter it
    says the filter is an "MS-DOS wildcard file filter specification."
    Obviously, *.test.txt does work in MS-DOS. In fact, using the same control,
    comdlg32.dll, that Excel's GetOpenFileName method uses outside of Excel works
    just fine. It is an obvious code change in Excel but I wanted to know if it
    was intentional or not.

    Ryan

    "Tom Ogilvy" wrote:

    > GetOpenFilename has always only supported filtering on an extension. In
    > your case, the extension is .txt. If you were able to get it to filter
    > ..test.txt, then you were fortunate, but that isn't the advertised behavior -
    > so you were utilizing an undocumented capability. You use undocumented
    > capabilities at your own risk since they may not be supported in later
    > versions.
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    > <[email protected]> wrote in message
    > news:[email protected]...
    > > In Excel 2000, using the GetOpenFileName method you can include a

    > FileFilter
    > > (the first argument) such as *.something.extension and the dialog box

    > would
    > > show those files.
    > >
    > > Starting in Excel XP that does not work in code anymore. You can

    > physically
    > > type that into the dialog box under "File name" and it will work but when

    > it
    > > is set in code it will only recognize *.extension.
    > >
    > > Is this a design change or a bug?
    > >
    > > Sample code:
    > > ----------------
    > > FileName = Application.GetOpenFilename("Sample Files (*.test.txt),
    > > *.test.txt")
    > > ----------------
    > > This will not show a file named First.test.txt in Excel XP/2003 but the

    > same
    > > code will show the file in Excel 2000.
    > >
    > > Ryan
    > >

    >
    >
    >


  4. #4
    Tom Ogilvy
    Guest

    Re: GetOpenFileName method different in Excel

    Call MS support and I am sure they will answer your question for a fee.
    Unless you have some type of support agreement with microsoft, you will not
    get an answer from Microsoft here. this is peer-to-peer support.
    Otherwise, you can assume it is an intentional design change. <g>

    --
    Regards,
    Tom Ogilvy

    <[email protected]> wrote in message
    news:[email protected]...
    > The first paramater to GetOpenFileName in Excel is called FileFilter not
    > extension. In fact in Excel 2003 Help on GetOpenFileName for FileFilter

    it
    > says the filter is an "MS-DOS wildcard file filter specification."
    > Obviously, *.test.txt does work in MS-DOS. In fact, using the same

    control,
    > comdlg32.dll, that Excel's GetOpenFileName method uses outside of Excel

    works
    > just fine. It is an obvious code change in Excel but I wanted to know if

    it
    > was intentional or not.
    >
    > Ryan
    >
    > "Tom Ogilvy" wrote:
    >
    > > GetOpenFilename has always only supported filtering on an extension. In
    > > your case, the extension is .txt. If you were able to get it to filter
    > > ..test.txt, then you were fortunate, but that isn't the advertised

    behavior -
    > > so you were utilizing an undocumented capability. You use undocumented
    > > capabilities at your own risk since they may not be supported in later
    > > versions.
    > >
    > > --
    > > Regards,
    > > Tom Ogilvy
    > >
    > > <[email protected]> wrote in message
    > > news:[email protected]...
    > > > In Excel 2000, using the GetOpenFileName method you can include a

    > > FileFilter
    > > > (the first argument) such as *.something.extension and the dialog box

    > > would
    > > > show those files.
    > > >
    > > > Starting in Excel XP that does not work in code anymore. You can

    > > physically
    > > > type that into the dialog box under "File name" and it will work but

    when
    > > it
    > > > is set in code it will only recognize *.extension.
    > > >
    > > > Is this a design change or a bug?
    > > >
    > > > Sample code:
    > > > ----------------
    > > > FileName = Application.GetOpenFilename("Sample Files (*.test.txt),
    > > > *.test.txt")
    > > > ----------------
    > > > This will not show a file named First.test.txt in Excel XP/2003 but

    the
    > > same
    > > > code will show the file in Excel 2000.
    > > >
    > > > Ryan
    > > >

    > >
    > >
    > >




  5. #5

    Re: GetOpenFileName method different in Excel

    I do have an MSDN Universal subscription which guarantees a Microsoft respone
    within 2 business days.

    Ryan

    "Tom Ogilvy" wrote:

    > Call MS support and I am sure they will answer your question for a fee.
    > Unless you have some type of support agreement with microsoft, you will not
    > get an answer from Microsoft here. this is peer-to-peer support.
    > Otherwise, you can assume it is an intentional design change. <g>
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    > <[email protected]> wrote in message
    > news:[email protected]...
    > > The first paramater to GetOpenFileName in Excel is called FileFilter not
    > > extension. In fact in Excel 2003 Help on GetOpenFileName for FileFilter

    > it
    > > says the filter is an "MS-DOS wildcard file filter specification."
    > > Obviously, *.test.txt does work in MS-DOS. In fact, using the same

    > control,
    > > comdlg32.dll, that Excel's GetOpenFileName method uses outside of Excel

    > works
    > > just fine. It is an obvious code change in Excel but I wanted to know if

    > it
    > > was intentional or not.
    > >
    > > Ryan
    > >
    > > "Tom Ogilvy" wrote:
    > >
    > > > GetOpenFilename has always only supported filtering on an extension. In
    > > > your case, the extension is .txt. If you were able to get it to filter
    > > > ..test.txt, then you were fortunate, but that isn't the advertised

    > behavior -
    > > > so you were utilizing an undocumented capability. You use undocumented
    > > > capabilities at your own risk since they may not be supported in later
    > > > versions.
    > > >
    > > > --
    > > > Regards,
    > > > Tom Ogilvy
    > > >
    > > > <[email protected]> wrote in message
    > > > news:[email protected]...
    > > > > In Excel 2000, using the GetOpenFileName method you can include a
    > > > FileFilter
    > > > > (the first argument) such as *.something.extension and the dialog box
    > > > would
    > > > > show those files.
    > > > >
    > > > > Starting in Excel XP that does not work in code anymore. You can
    > > > physically
    > > > > type that into the dialog box under "File name" and it will work but

    > when
    > > > it
    > > > > is set in code it will only recognize *.extension.
    > > > >
    > > > > Is this a design change or a bug?
    > > > >
    > > > > Sample code:
    > > > > ----------------
    > > > > FileName = Application.GetOpenFilename("Sample Files (*.test.txt),
    > > > > *.test.txt")
    > > > > ----------------
    > > > > This will not show a file named First.test.txt in Excel XP/2003 but

    > the
    > > > same
    > > > > code will show the file in Excel 2000.
    > > > >
    > > > > Ryan
    > > > >
    > > >
    > > >
    > > >

    >
    >
    >


  6. #6
    Tom Ogilvy
    Guest

    Re: GetOpenFileName method different in Excel

    I always wondered how that would work. How will they relate
    [email protected]am to your subscription. Do you have to register it
    somehow. Anyway, it shouldn't be long now <g>.

    --
    Regards,
    Tom Ogilvy

    <[email protected]> wrote in message
    news:[email protected]...
    > I do have an MSDN Universal subscription which guarantees a Microsoft

    respone
    > within 2 business days.
    >
    > Ryan
    >
    > "Tom Ogilvy" wrote:
    >
    > > Call MS support and I am sure they will answer your question for a fee.
    > > Unless you have some type of support agreement with microsoft, you will

    not
    > > get an answer from Microsoft here. this is peer-to-peer support.
    > > Otherwise, you can assume it is an intentional design change. <g>
    > >
    > > --
    > > Regards,
    > > Tom Ogilvy
    > >
    > > <[email protected]> wrote in message
    > > news:[email protected]...
    > > > The first paramater to GetOpenFileName in Excel is called FileFilter

    not
    > > > extension. In fact in Excel 2003 Help on GetOpenFileName for

    FileFilter
    > > it
    > > > says the filter is an "MS-DOS wildcard file filter specification."
    > > > Obviously, *.test.txt does work in MS-DOS. In fact, using the same

    > > control,
    > > > comdlg32.dll, that Excel's GetOpenFileName method uses outside of

    Excel
    > > works
    > > > just fine. It is an obvious code change in Excel but I wanted to know

    if
    > > it
    > > > was intentional or not.
    > > >
    > > > Ryan
    > > >
    > > > "Tom Ogilvy" wrote:
    > > >
    > > > > GetOpenFilename has always only supported filtering on an extension.

    In
    > > > > your case, the extension is .txt. If you were able to get it to

    filter
    > > > > ..test.txt, then you were fortunate, but that isn't the advertised

    > > behavior -
    > > > > so you were utilizing an undocumented capability. You use

    undocumented
    > > > > capabilities at your own risk since they may not be supported in

    later
    > > > > versions.
    > > > >
    > > > > --
    > > > > Regards,
    > > > > Tom Ogilvy
    > > > >
    > > > > <[email protected]> wrote in message
    > > > > news:[email protected]...
    > > > > > In Excel 2000, using the GetOpenFileName method you can include a
    > > > > FileFilter
    > > > > > (the first argument) such as *.something.extension and the dialog

    box
    > > > > would
    > > > > > show those files.
    > > > > >
    > > > > > Starting in Excel XP that does not work in code anymore. You can
    > > > > physically
    > > > > > type that into the dialog box under "File name" and it will work

    but
    > > when
    > > > > it
    > > > > > is set in code it will only recognize *.extension.
    > > > > >
    > > > > > Is this a design change or a bug?
    > > > > >
    > > > > > Sample code:
    > > > > > ----------------
    > > > > > FileName = Application.GetOpenFilename("Sample Files (*.test.txt),
    > > > > > *.test.txt")
    > > > > > ----------------
    > > > > > This will not show a file named First.test.txt in Excel XP/2003

    but
    > > the
    > > > > same
    > > > > > code will show the file in Excel 2000.
    > > > > >
    > > > > > Ryan
    > > > > >
    > > > >
    > > > >
    > > > >

    > >
    > >
    > >




  7. #7
    Peter Huang [MSFT]
    Guest

    Re: GetOpenFileName method different in Excel

    Hi Ryan,

    Sorry for delay reply. This is caused by that we did not recognize your
    post as managed customer.
    Based on the problem, so far I can reproduce the problem and I am
    researching the issue and I will update you with new information ASAP.

    Best regards,

    Peter Huang
    Microsoft Online Partner Support

    Get Secure! - www.microsoft.com/security
    This posting is provided "AS IS" with no warranties, and confers no rights.


  8. #8
    Peter Huang [MSFT]
    Guest

    Re: GetOpenFileName method different in Excel

    Hi Ryan,

    Since the windows file system is usually works as extension.
    e.g. *.txt means text.
    So I think our change is going to reflect the idea that use the *.ext to
    define the file type.
    If you still have any concern, please feel free to post here.

    Best regards,

    Peter Huang
    Microsoft Online Partner Support

    Get Secure! - www.microsoft.com/security
    This posting is provided "AS IS" with no warranties, and confers no rights.


+ 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