Hola, Este Codigo me resgistra los OCX
Option Explicit
Public Declare Function RegComCtl32 Lib "KewlButtonz.ocx" Alias "DllRegisterServer" () As Long
Public Declare Function UnRegComCtl32 Lib "KewlButtonz.ocx" Alias "DllUnregisterServer" () As Long
Public Const S_OK = &H0
Sub RegisterComCtl32()
On Error GoTo Err_Registration_Failed
If RegComCtl32 = S_OK Then
MsgBox "Archivo registrado"
Else
MsgBox "Archivo no registrado"
End If
Exit Sub
Err_Registration_Failed:
MsgBox "Error: " & Err.Number & " " & Err.Description
End Sub
Sub UnRegisterComCtl32()
On Error GoTo Err_Unregistration_Failed
If UnRegComCtl32 = S_OK Then
MsgBox "Archivo desregistrado"
Else
MsgBox "Archivo no desregistrado"
End If
Exit Sub
Err_Unregistration_Failed:
MsgBox "Error: " & Err.Number & " " & Err.Description
End Sub
El OCX es KewlButtonz.ocx, pero en este codigo esta ingresado directamente.. como aria para pasarlo como variable... ese decir que diga por ejemplo ArchivoOCX y ya le paso el nombre con cun ComanDialog