Using Windows Form to display Excel files

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SarahZ
    New Member
    • Jul 2007
    • 3

    #1

    Using Windows Form to display Excel files

    Hi all,
    I am working on a project which is using a windows form to locate an Excel file and then display it. I am trying to use two combo boxes to locate an Excel file. The two combo boxes will be two parts of the the file path. For example, the file path is c:\abc\xyz\def. xlk Because all the file are in the abc fold, the first combo box will display xyz and the second combo box will display def. The combination of the two combo boxes will locate the file. There will a Go button. After I click on the button the file will display in the windows form. I don't really know if it's doable with Visual basic .net. Please help me. Any help is much appreciated.
    Thank you soso much
  • Killer42
    Recognized Expert Expert
    • Oct 2006
    • 8429

    #2
    What have you tried so far? Which part is giving you trouble? Building the path? Interacting with Excel? Other?

    Comment

    • SarahZ
      New Member
      • Jul 2007
      • 3

      #3
      I am stucked on the part that how to link the two combobox together and link them to the path. I have checked a lot of tutorials, but I didn't find anything that explains how to work with two combobox.
      Thank you a million.

      Comment

      • kadghar
        Recognized Expert Top Contributor
        • Apr 2007
        • 1302

        #4
        Originally posted by SarahZ
        I am stucked on the part that how to link the two combobox together and link them to the path. I have checked a lot of tutorials, but I didn't find anything that explains how to work with two combobox.
        Thank you a million.
        Im not sure this will help in .net, but in vb and vba you use:

        Combobox1.list( n) to get the (n - 1)th element...
        if you want to know the index of the selected item use combobox1.listi ndex

        so if you want to get the path it'll help something like

        dim path as string

        path = "c:\abc\" & combobox1.list( combobox1.listi ndex) & "\" & combobox2.list( combobox2.listi ndex) & ".xlk"

        hope that helps.

        Comment

        • SarahZ
          New Member
          • Jul 2007
          • 3

          #5
          Thank you so much. It definitely helps. I was just wondering if anybody knows where I can find some tutorials on combobox topics?
          Thank you

          Comment

          • Killer42
            Recognized Expert Expert
            • Oct 2006
            • 8429

            #6
            Originally posted by SarahZ
            Thank you so much. It definitely helps. I was just wondering if anybody knows where I can find some tutorials on combobox topics?
            You could try here. I found that, along with about 218,000 other entries, by hitting Google with "vb combobox tutorial".

            Comment

            Working...