One could use the code below to start the flashing, but code would be needed
to turn off the flashing in response a user action.
In VB 6, I turn off suchflashung when the user moves the mouse over, or
clicks on, a control.
I guess, with Excel, you would want to stop the flashing when the user
maximizes Excel, so ypu would need to test in an application event.
Option Explicit
Private Const FLASHW_STOP = 0
Private Const FLASHW_CAPTION = &H1
Private Const FLASHW_TRAY = &H2
Private Const FLASHW_ALL = (FLASHW_CAPTION Or FLASHW_TRAY)
Private Const FLASHW_TIMER = &H4
Private Const FLASHW_TIMERNOFG = &HC
Private Type FLASHWINFO
cbSize As Long
hwnd As Long
dwFlags As Long
uCount As Long
dwTimeout As Long
End Type
Private Declare Function FlashWindow Lib "user32" (ByVal hwnd As Long,
ByVal bInvert As Long) As Long
Private Declare Function FlashWindowEx Lib "user32" (pfwi As FLASHWINFO)
As Boolean
Private Declare Function GetActiveWindow Lib "user32" () As Long
Public Sub FlashOnce()
Dim hwnd As Long
hwnd = GetActiveWindow()
FlashWindow hwnd, -1
End Sub
Public Sub KeepFlashing()
Dim FlashInfo As FLASHWINFO
Dim hwnd As Long
hwnd = GetActiveWindow()
FlashInfo.cbSize = Len(FlashInfo)
FlashInfo.dwFlags = FLASHW_ALL Or FLASHW_TIMER
FlashInfo.dwTimeout = 0
FlashInfo.hwnd = hwnd
FlashInfo.uCount = 0
FlashWindowEx FlashInfo
End Sub