Hi kurb,
not need dll or activeX
In UserForm module:
Option Explicit
Private Declare Function FindWindow& Lib "user32" Alias _
"FindWindowA" (ByVal lpClassName$, ByVal lpWindowName$)
Private Declare Function SetWindowLong& Lib "user32" Alias _
"SetWindowLongA" (ByVal hWnd&, ByVal nIndex& _
, ByVal dwNewLong&)
Private Declare Function EnableWindow& Lib "user32" _
(ByVal hWnd&, ByVal fEnable&)
Private Declare Function ShowWindow& Lib "user32" _
(ByVal hWnd&, ByVal nCmdShow&)
Private hWnd As Long
' Minimize in application
Private Sub UserForm_Initialize()
' Min: &H20000 / Max: &H10000 / Resize: &H40000
'Dim Style As Long
'Style = &H84C80080 Or &H20000 Or &H40000 ' => &H84CE0080
hWnd = FindWindow(vbNullString, Me.Caption)
SetWindowLong hWnd, -16, &H84CE0080
End Sub
Private Sub UserForm_Activate()
' Minimize in TaskBar (activate following lines)
'ShowWindow hWnd, 0
'SetWindowLong hWnd, -20, &H40101
'ShowWindow hWnd, 1
' no modal userform for xl97
EnableWindow FindWindow(vbNullString, Application.Caption), 1
End Sub
In standard module:
Sub FormShow()
#If VBA6 Then
UserForm1.Show 0
#Else
UserForm1.Show
#End If
End Sub
Regards,
MP