.Filter for CSV and XLS files

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • S.Byers

    .Filter for CSV and XLS files

    I want to list *.CSV and *.XLS files in a drop down menu using

    dlgFileToImport .Filter = "CSV Files (*.csv)| *.csv"
    dlgFileToImport .Filter = "Excel Files (*.xls)| *.xls"
    dlgFileToImport .DefaultExt = ".csv"

    Please what is the syntax for ORing these two requirements.

    Many thanks - SB
  • Rick Rothstein

    #2
    Re: .Filter for CSV and XLS files

    > I want to list *.CSV and *.XLS files in a drop down menu using[color=blue]
    >
    > dlgFileToImport .Filter = "CSV Files (*.csv)| *.csv"
    > dlgFileToImport .Filter = "Excel Files (*.xls)| *.xls"
    > dlgFileToImport .DefaultExt = ".csv"
    >
    > Please what is the syntax for ORing these two requirements.[/color]

    Can I assume we are talking about a Microsoft CommonDialog control? If so,
    I'd do it the same way the help files show...

    With dlgFileToImport
    .Filter = "CSV Files (*.csv)|*.csv|E xcel Files (*.xls)|*.xls"
    .FilterIndex = 1
    .ShowOpen
    End With

    Rick - MVP


    Comment

    • S.Byers

      #3
      Re: .Filter for CSV and XLS files

      Thank you Rick. Just what I neded. I don't have access to the Help
      files. My version of VB6 at work was not installed with them, and when
      I click on Help all I get are references to MSDN again which was also
      not installed. SB.

      "Rick Rothstein" <rickNOSPAMnews @NOSPAMcomcast. net> wrote in message news:<xNudnb2Da L6YFDeiRVn-iQ@comcast.com> ...[color=blue][color=green]
      > > I want to list *.CSV and *.XLS files in a drop down menu using
      > >
      > > dlgFileToImport .Filter = "CSV Files (*.csv)| *.csv"
      > > dlgFileToImport .Filter = "Excel Files (*.xls)| *.xls"
      > > dlgFileToImport .DefaultExt = ".csv"
      > >
      > > Please what is the syntax for ORing these two requirements.[/color]
      >
      > Can I assume we are talking about a Microsoft CommonDialog control? If so,
      > I'd do it the same way the help files show...
      >
      > With dlgFileToImport
      > .Filter = "CSV Files (*.csv)|*.csv|E xcel Files (*.xls)|*.xls"
      > .FilterIndex = 1
      > .ShowOpen
      > End With
      >
      > Rick - MVP[/color]

      Comment

      • Rick Rothstein

        #4
        Re: .Filter for CSV and XLS files

        > Thank you Rick. Just what I neded. I don't have access to the Help[color=blue]
        > files. My version of VB6 at work was not installed with them, and when
        > I click on Help all I get are references to MSDN again which was also
        > not installed. SB.[/color]

        You should ask whoever is in charge of such thing to install it... it is
        ludicrous to not have it available.

        Although more awkward to use, you can view the entire MSDN (which contains
        the VB help files) online at this link...



        Specifically, open the "tree" to this...

        Visual Tools and Languages
        Visual Studio 6.0
        Visual Basic 6.0
        Product Documentation
        Reference
        Language Reference

        Look around under Reference for other things you might find interesting.

        Rick - MVP


        Comment

        Working...