Private Declare Function Beep Lib "kernel32" (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long
Sub bb()
t = Timer
If [a1].Value = 5 Then
UserForm1.Show 0
Application.OnTime Now + TimeSerial(0, 0, 1), "bb"
[a1] = [a1] - 1
Beep 800, 50
ElseIf [a1].Value = 0 Then
Beep 1000, 100
MsgBox "时间到!"
Unload UserForm1
Else
Application.OnTime Now + TimeSerial(0, 0, 1), "bb"
[a1] = [a1] - 1
Beep 800, 50
End If
End Sub
222222222222222222222222222222222222222222222222222222
如果用VBA代码播放WAV声音文件,可以用下面的代码:
Private Declare Function sndPlaySound32 _
Lib "winmm.dll" _
Alias "sndPlaySoundA" ( _
ByVal lpszSoundName As String, _
ByVal uFlags As Long) As Long
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余4页未读,立即下载