• File Chooser (Excel 2000)

    Author
    Topic
    #396908

    Hi All,

    Is there a way to automatically prompt the user for a choice selection from a drop-down and then process that file AND … have this happen when they open the file?

    Right now, the user opens the file, clicks on a particular cell which has the choices (via data validation). After making the selection, the user clicks on a macro button that then opens the selected Study Data file and processes it.

    I need to impress my users and, unfortunately, something like this would!

    Any help would be appreciated…
    –cat

    Viewing 1 reply thread
    Author
    Replies
    • #747441

      You could create userform with the combobox range linked to the same list that is currently in datavalidation
      On workbook_open, run the userform,
      based on selection,
      open the file
      process any macros.

      If you need more help, you will have to provide some more details

      Steve

      • #747473

        Hi Steve, thanks.
        I have never used a UserForm (or the Combo Box within it) … and I’m a self-taught VB user (which could explain a lot of things!). If you could help with some basic code for a UserForm that uses a combo box … I could probably take it from there. (Hopefully!)
        Thanks,
        –cat

        • #747532

          Check out this MS Tutorial on creating a custom form.

          Post back with any specific questions you might have

          Steve

        • #747533

          Check out this MS Tutorial on creating a custom form.

          Post back with any specific questions you might have

          Steve

        • #747534

          Cindy are you looking to provide the user with a choice of only a certain set of files, or are you looking for all files in a certain directory, or what? Depending on what you are doing, there might be some cookie cutter alternatives to a userform.

          • #747580

            John, I’m looking for all files in a directory, but it could be a named range that I maintain within the excel file.
            Cindy

            • #747607

              The code below will display a standard File Open dialog box and then opens the file selected by the user:

              Dim vFileToOpen As Variant
                  vFileToOpen = Application.GetOpenFilename("xls,*.xls")
                  If vFileToOpen  False Then
                      Workbooks.Open Filename:=vFileToOpen
                  End If
              
            • #747608

              The code below will display a standard File Open dialog box and then opens the file selected by the user:

              Dim vFileToOpen As Variant
                  vFileToOpen = Application.GetOpenFilename("xls,*.xls")
                  If vFileToOpen  False Then
                      Workbooks.Open Filename:=vFileToOpen
                  End If
              
            • #747670

              Since Legare has explained what I was thinking that might fit your requirements, just two more notes:

              GetOpenFilename has a Multiselect Option which allows the user to select multiple files which are returned as an array and which you can then process.

              You can guide the user to a specific directory by preceding the GetopenFilename statement with

              ChDir “C:”

            • #747671

              Since Legare has explained what I was thinking that might fit your requirements, just two more notes:

              GetOpenFilename has a Multiselect Option which allows the user to select multiple files which are returned as an array and which you can then process.

              You can guide the user to a specific directory by preceding the GetopenFilename statement with

              ChDir “C:”

          • #747581

            John, I’m looking for all files in a directory, but it could be a named range that I maintain within the excel file.
            Cindy

        • #747535

          Cindy are you looking to provide the user with a choice of only a certain set of files, or are you looking for all files in a certain directory, or what? Depending on what you are doing, there might be some cookie cutter alternatives to a userform.

      • #747474

        Hi Steve, thanks.
        I have never used a UserForm (or the Combo Box within it) … and I’m a self-taught VB user (which could explain a lot of things!). If you could help with some basic code for a UserForm that uses a combo box … I could probably take it from there. (Hopefully!)
        Thanks,
        –cat

    • #747442

      You could create userform with the combobox range linked to the same list that is currently in datavalidation
      On workbook_open, run the userform,
      based on selection,
      open the file
      process any macros.

      If you need more help, you will have to provide some more details

      Steve

    Viewing 1 reply thread
    Reply To: File Chooser (Excel 2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: