Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Most of the time, my PC runs silently. I am easily irritated by sounds of
windows opening, etc. etc. But exceptionally, I would like to be advised of an unusual event by playing a Wav file through code. Is there a pair of lines that I can add to enable before, and mute after the required sound has played? Here is an example: Private Declare Function PlaySound Lib "winmm.dll" _ Alias "PlaySoundA" (ByVal lpszName As String, _ ByVal hModule As Long, ByVal dwFlags As Long) As Long Public Sub PrinterCheck() Dim int1as integer Dim strWavFile As String int1 = MsgBox("Ready to Print?", vbYesNoCancel) boolNP = True If int1 = 6 Then strWavFile = ThisWorkbook.Path & "\sound1.wav" boolNP = False ElseIf int1 = 7 Then strWavFile = ThisWorkbook.Path & "\sound2.wav" End If Call PlaySound(strWavFile, 0&, SND_ASYNC Or SND_FILENAME) End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Running Excel 2003 on Windows 7 | New Users to Excel | |||
Running a macro from windows application | Excel Discussion (Misc queries) | |||
i have two windows xp running on my pc and seem to con flict with | Excel Discussion (Misc queries) | |||
Status bar (or similar) to appear whilst running a long macro | Excel Discussion (Misc queries) | |||
running windows system commands in VBA | Excel Programming |