Listview add at run time with class module for event handling

switters_aka

Board Regular
Joined
Oct 26, 2010
Messages
118
I'm having problems deploying a vba project on PCs throughout my organisation due to differences in windows configurations (I think). I have checked that MSCOMCTL.ocx is available on each PC and the listview control is available in the form controls menu (tools). As a side note, when I tried to register the .ocx file it failed to do so saying the DLL file isn't in the library. It is possible to add the LV control to a userform created on the machines which won't accept the import: to be precise, the import doesn't fail, but the LV control doesn't load because it says the object failed to load - which is weird because the reference to common controls is set and the control exists in the tools menu. The form is there and every other control except the listview.

I felt that the solution to this might be to create the control at run time and use a class module to handle event but I have two problems with this:
1) I don't know how to do it and
2) I read this morning that even doing this might not solve the problem.

I would like to give it a try though to see if it does solve the problem and would like to request one of you kind folks to share with me a class module which will handle item and column click events and instructions on how to run it from a module.

If however there is another suggestion on how to reliably deploy projects with a listview or alternative, I would be delighted to hear about it.

Thanks in advance for any support.
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

Forum statistics

Threads
1,214,419
Messages
6,119,389
Members
448,891
Latest member
tpierce

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