add ocx reference at runtime and programatically

G

Guest

I'm want to programatically add a reference to an OCX file so my users do not have to manually go to 'tools', 'references', 'browse'. Is there a way to register a valid OCX file in the system32 directory in a fasion simular to registerxll?
 
R

Rob van Gelder

Sub test()
ThisWorkbook.VBProject.References.AddFromFile
"C:\WINDOWS\SYSTEM32\COMCTL32.OCX"
End Sub

--
Rob van Gelder - http://www.vangelder.co.nz/excel


Kevin said:
I'm want to programatically add a reference to an OCX file so my users do
not have to manually go to 'tools', 'references', 'browse'. Is there a way
to register a valid OCX file in the system32 directory in a fasion simular
to registerxll?
 

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