Public Sub RegDllOrOcx(ByVal sFile as String,ByVal bRegister) Dim hModule As Long, lpProcAddr As Long hModule = LoadLibrary(sFile) lpProcAddr = GetProcAddress(hModule, IIf(bRegister, "DllRegisterServer", "DllUnregisterServer")) Call CallWindowProc(lpProcAddr, 0, 0, 0, 0) FreeLibrary hModule End Sub