Como hacer un Splash que se ejecute al abrir archivo de excel

Tengo un código que en teoría debería ejecutar un splash a la hora de abrir mi archivo de excel, sin embrago no hace nada.

Creo que esta muy complejo este código, ¿hay una manera mas fácil de hacer que esta tarea se realice?

Comparto código.

Option Explicit
'
'validamos la versión de Office y llamamos API's
'
#If VBA7 And Win64 Then
Declare PtrSafe Function FindWindow Lib "USER32" _
Alias "FindWindowA" (ByVal lpClassName As String, _
ByVal lpWindowName As String) As LongPtr
'
Declare PtrSafe Function GetWindowLongPtr Lib "USER32" _
Alias "GetWindowLongPtrA" (ByVal hWnd As LongPtr, ByVal nIndex As Long) As LongPtr
'
Declare PtrSafe Function SetWindowLongPtr Lib "USER32" _
Alias "SetWindowLongPtrA" (ByVal hWnd As LongPtr, _
ByVal nIndex As Long, ByVal dwNewLong As LongPtr) As LongPtr
'
Declare PtrSafe Function DrawMenuBar Lib "USER32" (ByVal hWnd As LongPtr) As Long
'
#Else
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 Declare Function DrawMenuBar Lib "USER32" (ByVal hWnd As Long) As Long
'
#End If
'
Sub RemoveCaption(objForm As Object)
'
'Usamos esta procedimiento para ocultar la barra de título
'
#If VBA7 Then
Dim hMenu As LongPtr
Dim mhWndForm As LongPtr
Dim lStyle As LongPtr
#Else
Dim hMenu As Long
Dim mhWndForm As Long
Dim lStyle As Long
#End If
'
If Val(Application.Version) < 9 Then
mhWndForm = FindWindow("ThunderXFrame", objForm.Caption)
Else
mhWndForm = FindWindow("ThunderDFrame", objForm.Caption)
End If
'
#If VBA7 And Win64 Then
'
lStyle = GetWindowLongPtr(mhWndForm, -16)
lStyle = lStyle And Not &HC00000
SetWindowLongPtr mhWndForm, -16, lStyle
DrawMenuBar mhWndForm
'
#Else
lStyle = GetWindowLong(mhWndForm, -16)
lStyle = lStyle And Not &HC00000
SetWindowLong mhWndForm, -16, lStyle
DrawMenuBar mhWndForm
'
#End If
'
End Sub
'
Sub ShowForm()
'
'Mandamos llamar al Formulario
'
SplashForm.Show vbModeless
'
End Sub
'
Private Sub CerrarFormularioSplash()
'
'Cerramos el formulario
'
Unload frmSplash
'
End Sub

Private Sub UserForm_Click()

End Sub

1 Respuesta

Respuesta
1

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas