add ocx reference at runtime and programatically

K

Kevin

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?
 
Top