SaberExcel - o site das macros
Estas macros e declarações do Aplicativo Microsoft Excel VBA(Visual Basic Application), .
'piscar tela do excel
Public Const R2_XORPEN = 7
Public Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Declare Function GetWindowDC Lib "user32" (ByVal hwnd As Long) As Long
Declare Function Rectangle Lib "gdi32" (ByVal hdc As Long, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Declare Function SetROP2 Lib "gdi32" (ByVal hdc As Long, ByVal nDrawMode As Long) As Long
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Sub Piscar_Tela()
Dim hwnd, DC As Long
Dim Pos As RECT
Dim I As Integer
hwnd = FindWindow("xlmain", Application.Caption)
DC = GetWindowDC(hwnd)
GetWindowRect hwnd, Pos
SetROP2 DC, R2_XORPEN
For I = 1 To 5
Rectangle DC, 0, 0, Pos.Right, Pos.Bottom
Sleep (100)
Rectangle DC, 0, 0, Pos.Right, Pos.Bottom
If I <> 5 Then
Sleep (100)
Else
Exit Sub
End If
Next I
End Sub
Aprenda tudo sobre o Aplicativo Microsoft Excel VBA com Saberexcel