About Lisview control

P

palo

How to use listview control in userform? I can't add listview control in
toolbox. Help me. Thanks
 
R

RB Smissaert

You need to set a reference by doing in the VBE:
Tools, References and browse to C:\Windows\System32\MSComctl32.ocx
The path could be different if you are not on Win XP.
After that the Listview will be available in the control toolbox.

RBS
 
P

palo

Thanks you!
In my system32, only has MSCOMCTL.OCX and COMCTL32.OCX. I have set
references this files, however, it's still not working.
 
R

RB Smissaert

Sorry, I posted wrong, it should be:
C:\Windows\System32\MSComctl.ocx
So, set a reference to that one and un-tick the other one.

Don't think there is a MSComctl32.ocx, but there is MSComct2.ocx, which
I think holds the Monthview control.

RBS
 
P

palo

I have set a reference to MSComctl.oxc. But menu Tools/Additionnal
Controls...not work.
 
R

RB Smissaert

Did you add the reference to the right project?
When you say: not work, do you mean the listview doesn't show in the list
of controls to add?
What Windows version are you on?
What is the version of the file MSComctl.ocx?

RBS
 
P

palo

My computer's Windows version is M. Windows XP professional version 2002 SP2.
The MSComctl.ocx is M. Windows Common Control 6.0.
I add the reference in References-VBAProject box. And when I click
Additional Controls in menu Tools, nothing happens.
 
R

RB Smissaert

What is the project called with the form?
Have the form visible (right-click the form, view object), load the control
toolbox and right-click in the bottom bit (the empty bit) of the toolbox and
do
Additional controls, tick Microsoft Listview Control, version 6.0

RBS
 
P

palo

what do you mean by project called with this form?
if you rasking about project's, it's book1
I right-click in the bottom bit (the empty bit) of the toolbox and
click Additional controls but nothing happens.
 
R

RB Smissaert

OK, I should have said what it the project with the form called.
Try 2 things:
In the VBE: Debug, Compile
Does that go OK, or does it fail?
If it fails then fix that first.
Also try after saving the project.

RBS
 
P

palo

I have tried to debug, compile but it fail, I have tried but don't know
what's wrong with it. Do you know what I need to do to make it work?
 
R

RB Smissaert

When you do Debug, Compile and it fails then normally it will tell you
what the problem is. Wasn't there any message about what made the
compile fail? Or are you saying it compiled fine, but the toolbox still
didn't do additional controls?

RBS
 
P

palo

Compilation is fine, but the toolbox still does not do any additional
controls. Do I need to reinstall the Microsoft office?
 
R

RB Smissaert

Are you in the VBE and is there a form in the project?
Make sure to have the form visible in the VBE and then launch the toolbox.
If you did all that then yes maybe re-install Office.

RBS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top