Re: Using Countdown in Status Bar to Play Sound
From: Bob Phillips (bob.phillips_at_notheretiscali.co.uk)
Date: 02/06/04
- Next message: Paul LaPlant: "Re: Refresh a PivotTable using VBA (SQL generated Pivot)"
- Previous message: Jonathan: "Hiding all Toolbars"
- In reply to: Full Monty: "Using Countdown in Status Bar to Play Sound"
- Next in thread: Full Monty: "Re: Using Countdown in Status Bar to Play Sound"
- Reply: Full Monty: "Re: Using Countdown in Status Bar to Play Sound"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 6 Feb 2004 15:09:59 -0000
Monty,
Here's some code to play a WAV file
Const SND_SYNC = &H0
Const SND_ASYNC = &H1
Const SND_FILENAME = &H20000
Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" _
(ByVal lpszName As String, _
ByVal hModule As Long, _
ByVal dwFlags As Long) As Long
Sub PlayWAVFile(Optional Async As Boolean = True)
Dim WavFile As String
WavFile = "chimes.wav"
WavFile = "C:\Windows\Media\" & WavFile
If Async Then
Call PlaySound(WavFile, 0&, SND_ASYNC Or SND_FILENAME)
Else
Call PlaySound(WavFile, 0&, SND_SYNC Or SND_FILENAME)
End If
End Sub
If you need to know how to insert it in your code, we will need to see that
--
HTH
Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
"Full Monty >" <<Full.Monty.117m8e@excelforum-nospam.com> wrote in message
news:Full.Monty.117m8e@excelforum-nospam.com...
> Running Excel 97:
>
> Currently using a Countdown (shown in the Excel tips) from 180 to 0 in
> th status bar as a timer.
>
> Would like Excel to automatically play a corresponding WAV file once
> the countdown reaches certain intervals. (30, 10, 0)
>
> Each of the three intervals listed would have their own WAV file.
>
> I am just learning VBA and this site has been very helpful thus far.
> But I am stuck at this point and don't know how to proceed.
>
> Thanks for the help!
>
>
> ---
> Message posted from http://www.ExcelForum.com/
>
- Next message: Paul LaPlant: "Re: Refresh a PivotTable using VBA (SQL generated Pivot)"
- Previous message: Jonathan: "Hiding all Toolbars"
- In reply to: Full Monty: "Using Countdown in Status Bar to Play Sound"
- Next in thread: Full Monty: "Re: Using Countdown in Status Bar to Play Sound"
- Reply: Full Monty: "Re: Using Countdown in Status Bar to Play Sound"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|