Alarme
-
Upload
allysonmartins -
Category
Documents
-
view
215 -
download
1
description
Transcript of Alarme
Plan12/2/11 13:52Obs:1 - Infelizmente no excel os eventos automticos s executam se o aplicativoestiver aberto (o aplicativo, e no o relatrio)2 - Para ativar o evento clique no boto. Todos os dias, no horrio estipulado,o relatrio ser impresso.3 - Quando no quiser mais, no esquea de clicar no boto "Desativar...".Clique "Alt F11" e adpte o mdulo no seu relatrioUm abrao.
Attribute VB_Name = "Plan1"Attribute VB_Base = "0{00020820-0000-0000-C000-000000000046}"Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = FalseAttribute VB_PredeclaredId = TrueAttribute VB_Exposed = TrueAttribute VB_TemplateDerived = FalseAttribute VB_Customizable = TrueAttribute VB_Control = "CommandButton1, 3, 0, MSForms, CommandButton"Private Sub CommandButton1_Click()AlarmeAutomticoEnd Sub
Attribute VB_Name = "EstaPasta_de_trabalho"Attribute VB_Base = "0{00020819-0000-0000-C000-000000000046}"Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = FalseAttribute VB_PredeclaredId = TrueAttribute VB_Exposed = TrueAttribute VB_TemplateDerived = FalseAttribute VB_Customizable = True
Attribute VB_Name = "Mdulo2"Option ExplicitDeclare Function GetTickCount Lib "kernel32" () As LongDeclare Function sndPlaysound Lib "winmm.dll" Alias _"sndPlaySoundA" (ByVal lpszSoundName As String, _ByVal uFlags As Long) As LongDeclare Function GetAsyncKeyState Lib "User32.dll" (ByVal vKey As Long) As LongSub PlaySound(Ps As Byte, Kk As Byte) Dim I As Byte I = sndPlaysound(ThisWorkbook.Path + "\SOM\S" & Ps, Kk)End SubSub Som()PlaySound 8, 1End Sub
Attribute VB_Name = "Modulo1"Sub AlarmeAutomtico()Application.OnTime Plan1.Range("A4"), "Meu_Procedimento"End Sub
Sub Meu_Procedimento() Som ActiveWorkbook.Saved = False ActiveWorkbook.CloseEnd Sub
Sub DesativarAlarmeAutomtico()Application.OnTime EarliestTime:=#9/20/2010# + TimeValue("15:26:00"), _ Procedure:="Meu_Procedimento", Schedule:=FalseEnd Sub