OVH Cloud OVH Cloud

affichage d'un msgbox lors du calcul de ma feuille.

2 réponses
Avatar
rick
Bonjour,

J'ai cette macro de barre de progression (msgbox), et je souhaite l'afficher
pendant le calcul de ma feuille.
c'est à dire ce que je voit en bas de la feuille "Recalcul 0%..15%..."
je veux le voir afficher sur ce type de msgbox.
Sub MsgBox_RealPBar()
Const GWL_HINSTANCE = -6
Const WH_CBT As Long = &H5
Const COLOR_BTNFACE As Integer = 15
Dim hWnd As Long

If Not okVersion Then Exit Sub
nPct = -1 ' initialize flag...
BarColor = vbRed
BkColor = GetSysColor(COLOR_BTNFACE)
TitleMsgBox = "Real ProgressBar demo"
strMsg = Space(15) & "Processing, please wait..." & vbLf & Space(80) &
vbLf & vbLf
hWnd = FindWindow("XLMAIN", Application.Caption)
hInstance = GetWindowLong(hWnd, GWL_HINSTANCE): hIcon = 0
PathIco = ThisWorkbook.Path & "\Globe.ani"
msgHook = SetWindowsHookEx(WH_CBT, AddressOf MsgBoxHookProc, hInstance,
GetCurrentThreadId())
StartTimer 1000
'Aucune icône vb.. standard ne doit être invoquée !
MsgBox strMsg, 0, TitleMsgBox
EndTimer
End Sub

est ce possible

2 réponses

Avatar
Michel NOLF
Ou as-tu vu que les anglais pouvaient parler francais. Commence par traduire
ta macro en français pour essayer de la comprendre.
"rick" a écrit dans le message de news:

Bonjour,

J'ai cette macro de barre de progression (msgbox), et je souhaite
l'afficher
pendant le calcul de ma feuille.
c'est à dire ce que je voit en bas de la feuille "Recalcul 0%..15%..."
je veux le voir afficher sur ce type de msgbox.
Sub MsgBox_RealPBar()
Const GWL_HINSTANCE = -6
Const WH_CBT As Long = &H5
Const COLOR_BTNFACE As Integer = 15
Dim hWnd As Long

If Not okVersion Then Exit Sub
nPct = -1 ' initialize flag...
BarColor = vbRed
BkColor = GetSysColor(COLOR_BTNFACE)
TitleMsgBox = "Real ProgressBar demo"
strMsg = Space(15) & "Processing, please wait..." & vbLf & Space(80) &
vbLf & vbLf
hWnd = FindWindow("XLMAIN", Application.Caption)
hInstance = GetWindowLong(hWnd, GWL_HINSTANCE): hIcon = 0
PathIco = ThisWorkbook.Path & "Globe.ani"
msgHook = SetWindowsHookEx(WH_CBT, AddressOf MsgBoxHookProc, hInstance,
GetCurrentThreadId())
StartTimer 1000
'Aucune icône vb.. standard ne doit être invoquée !
MsgBox strMsg, 0, TitleMsgBox
EndTimer
End Sub

est ce possible


Avatar
Clément Marcotte
Bonjour,

"Sa" macro appelle 4 fonctions de l'API Windows ( GetSysColor,
FindWindow, GetWindowLong et SetWindowsHookEx ), 2 autres macros non
listées là (GetCurrentThreadId et StartTimer) et 1 curseur animé
(Globe.ani).

Si on peut trouver les instructions de déclaration des fonctions API,
faut quand même inventer GetCurrentThreadId et StartTimer et trouver
le curseur animé. Une affaire de rien quoi...


--
On apprend pas à un vieux singe à faire des grimaces

"Michel NOLF" a écrit dans le
message de news:
Ou as-tu vu que les anglais pouvaient parler francais. Commence par
traduire

ta macro en français pour essayer de la comprendre.
"rick" a écrit dans le message de
news:


Bonjour,

J'ai cette macro de barre de progression (msgbox), et je souhaite
l'afficher
pendant le calcul de ma feuille.
c'est à dire ce que je voit en bas de la feuille "Recalcul
0%..15%..."


je veux le voir afficher sur ce type de msgbox.
Sub MsgBox_RealPBar()
Const GWL_HINSTANCE = -6
Const WH_CBT As Long = &H5
Const COLOR_BTNFACE As Integer = 15
Dim hWnd As Long

If Not okVersion Then Exit Sub
nPct = -1 ' initialize flag...
BarColor = vbRed
BkColor = GetSysColor(COLOR_BTNFACE)
TitleMsgBox = "Real ProgressBar demo"
strMsg = Space(15) & "Processing, please wait..." & vbLf &
Space(80) &


vbLf & vbLf
hWnd = FindWindow("XLMAIN", Application.Caption)
hInstance = GetWindowLong(hWnd, GWL_HINSTANCE): hIcon = 0
PathIco = ThisWorkbook.Path & "Globe.ani"
msgHook = SetWindowsHookEx(WH_CBT, AddressOf MsgBoxHookProc,
hInstance,


GetCurrentThreadId())
StartTimer 1000
'Aucune icône vb.. standard ne doit être invoquée !
MsgBox strMsg, 0, TitleMsgBox
EndTimer
End Sub

est ce possible