I am trying to do exactly the same as written in the second port.
I have a module with Aut

pen Sub which have to call userform "tmp" immediately when I open my workbook
Sub Aut

pen()
tmp.Show
End Sub
I created this user form wrote in uberform's code the following:
Const GWL_STYLE = (-16)
Const WS_SYSMENU = &H80000
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
--------------------------------------------------------
Private Sub UserForm_Initialize()
'this hides the X on the caption line
Dim hWnd As Long, a As Long
hWnd = FindWindow("ThunderXFrame", Me.Caption)
a = GetWindowLong(hWnd, GWL_STYLE)
SetWindowLong hWnd, GWL_STYLE, a And Not WS_SYSMENU
End Sub
-------------------------------------------------------
But when I open my workbook I am getting "tmp" userform WITH blue title bar i.e without modification. Can somebody explain me what I am doing wrong?