No treeview reference

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Seth Schrock
    Recognized Expert Specialist
    • Dec 2010
    • 2965

    #1

    No treeview reference

    I'm trying to use an ActiveX treeview control. I was trying to declare it in VBA and discovered that there was no option for declaring a variable as MsComctlLib.Tre eView. I'm assuming that this is a reference problem, but I can't find a reference that specifically says for the treeview and I can't find online what reference it requires. I also checked, and I don't have the MsComctlLib file on my computer which I would assume that I would need. Where can I get it and how do I add it to the references list?
  • zmbd
    Recognized Expert Moderator Expert
    • Mar 2012
    • 5501

    #2
    Just because I'm dense.... you tried (now I'm speaking in version 2010 which is OFFICE14 on the hard-drive install:
    Form in design mode.
    Insert activex control
    Microsoft Treview Control, Version 6.0

    this either was not available or did not work?

    Open VBA editor:
    Tools
    References
    [X] Microsoft Office 14 Object Library
    [X] Microsoft ActiveX Dataobjects 2.1 Library

    You need "mscomctl.o cx" if I remember correctly. IN a WinXP install it is in the "windows\system 32"


    OK - I'm pushing 20 hours up time and I need to be back up and out within the next 5 hours so time for a nap

    Merry Christmas to those who are in the 25th and Happy Christmas Eve that are in the same boat with me!

    A sip of EggfNoggg..,..! !!!, !!!!! zzzzzzzzz

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32669

      #3
      Does Smiley's article not explain how to get hold of the library Seth?

      I use Win XP still and the file is found on my system as :
      C:\WINDOWS\syst em32\mscomctl.o cx

      If you don't have this available then you need to get hold of and install it before trying to access it ;-)

      Comment

      • Seth Schrock
        Recognized Expert Specialist
        • Dec 2010
        • 2965

        #4
        @Z I'm using Access 2010 as well. Inserting the control worked just fine. My problem came in the VBA editor when trying to declare a variable as a treeview as Smiley had in his video
        Code:
        Dim tv As MsComctlLib.TreeView
        I assumed that this meant that I needed the MsComctlLib file. I already had the reference to the Microsoft Office 14 Object Library selected, but not the Microsoft ActiveX Dataobjects 2.1 Library. However, adding that later didn't fix it.

        I GOT IT! I found an article that said that Windows 7 x64 (what I have) stores its 32 bit drivers in the Windows\SysWOW6 4 folder (my office installation is 32 bit). In the References window, I browsed to that location, selected the MsComctl.ocx file which turns into the Microsoft Windows Common Controls 6.0 (SP6) reference. I selected it and it now works.

        @ NeoPa No Smiley doesn't tell how to get a hold of the library. I might add a comment to his YouTube video and suggest explaining that.

        One more question that might be a little off subject, but does anyone know how to add this reference when the user only has Microsoft Access Run-time 2010?

        Comment

        • NeoPa
          Recognized Expert Moderator MVP
          • Oct 2006
          • 32669

          #5
          You add it into the database as a developer Seth, so that it's already there when the user opens it.

          Comment

          • Seth Schrock
            Recognized Expert Specialist
            • Dec 2010
            • 2965

            #6
            Great! I don't have to worry about that then. Thanks NeoPa for that information and to everyone who posted trying to help me out. It is very much appreciated.

            Comment

            • NeoPa
              Recognized Expert Moderator MVP
              • Oct 2006
              • 32669

              #7
              Originally posted by Seth
              Seth:
              Great! I don't have to worry about that then.
              Absolutely not :-)

              Time to relax and join Z in an egg-nogg I think. Merry Christmas to all!

              Comment

              • TheSmileyCoder
                Recognized Expert Moderator Top Contributor
                • Dec 2009
                • 2322

                #8
                Merry christmas to you all.

                Usually when you design your form (as shown in the video) and insert the treeview active X control, my experience has always been that Access will automatically set the reference to the Microsoft Common Control Library (mscomctllib). See the video @ Treeview video @ time of Active X insertion

                Did your approach not follow the path outlined above?
                Last edited by TheSmileyCoder; Dec 25 '12, 08:32 PM.

                Comment

                • Seth Schrock
                  Recognized Expert Specialist
                  • Dec 2010
                  • 2965

                  #9
                  That is the way that I did it and the reference didn't come up until I manually added it. I'm not sure why it didn't. I was following along with your video and when I got to the loadTreeview function the first dim statement didn't work. Another anomaly that I have found is that the tree view object's properties (not the control properties) won't let me change the properties. I have had to make the changes (like the indent space) in VBA. Could this be for the same reason that the VBA reference didn't get made automatically?

                  Comment

                  • TheSmileyCoder
                    Recognized Expert Moderator Top Contributor
                    • Dec 2009
                    • 2322

                    #10
                    Hi Seth
                    I believe it may be related to a issue in which Microsoft released a update to the MScomCtlLib which was incorrectly patched by microsoft, causing registry errors.

                    I believe if you follow the advice laid out in:
                    Resolves a vulnerability that exists in Windows common controls that could allow remote code execution if a user visits a website that contains specially crafted content designed to exploit the vulnerability.

                    Your results should more closely match my video. If you do follow the advice, please let me know, so that I know to create a addendum of sorts to my treeview vid.

                    Comment

                    • Seth Schrock
                      Recognized Expert Specialist
                      • Dec 2010
                      • 2965

                      #11
                      I ran the update and now the treeview object properties are working correctly and the reference to the Microsoft Common Control Library is added automatically. Thanks Smiley!

                      Comment

                      Working...