Problems with MSComctlLib Library (common controls)

hatman

Well-known Member
Joined
Apr 8, 2005
Messages
2,664
So I like to use the ListView control where most people might be inclined to use ListBoxes. When you add a ListView to your project, Excel automatically adds a reference to the MSComctlLib library. This has worked FINE for 10 years or more.

One of my users suddenly started with an error yesterday, which I quickly found a solution to in This Article. I thought this was fixed, but it got loopy from here.

Upon restart, one of my forms with the ListView located directly on the USerform worked fine, but another form that has 6 ListViews one on each page a multipage, I get an error message indicating that the Referenced "Library Feature Not Supported", so I hit OKAY, and then I'm in Debug mode with the ListView control name highlighted in the Initialize code (me.[highlight]listview_Name[/highlight]). I stop the debugger, and then compile the project, and get an error that "Method or Data Member Not Found" for the properties of this code:

Code:
Sub List_View_Initialize(L_View As ListView)
 
    With L_View
        .View = lvwReport
        .Sorted = True
        .SortOrder = lvwAscending
        .FullRowSelect = False
        .AllowColumnReorder = True
        .Gridlines = True
        .LabelEdit = lvwAutomatic
        .Font.Size = 10
        .Font.Bold = False
    End With
End Sub

Which is the code that is called by the initialize event of teh userform with the listview that is causing teh error.

At this point, I tried unchecking the reference to the MSComctlLib Library, closed the references dialog. Then, I added a new Listview to a random form in teh project, allowing the automatic library reference to be built, and then deleted the control. Then I ran the form with the problem, and the code worked fine.... the project compiled fine. No problems. But I close and re-open the file, and everything is back to not working.

It gets more fun. This all repeated itself with a second computer this morning. The common thread? Both of these users are running Microsoft Visio 2010.

All that beng said, I wonder if the problem might not be related to the compatibility issue that exists when placing a listview in a Multipage container. And if so, what I can do to work around the issue. This isn't a place where I can justify changing this whole section of my UI just because 2 computers out of about 1000 are having a problem... then again, as we move to Windows 2010 over the course of the next couple of years, this may become more prevalent.
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

Forum statistics

Threads
1,224,574
Messages
6,179,628
Members
452,933
Latest member
patv

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top