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?
No treeview reference
Collapse
X
-
Tags: None
-
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 -
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
-
@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
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.Code:Dim tv As MsComctlLib.TreeView
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
-
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
-
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
-
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
-
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
-
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
Comment