Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Play and stop sound



I'm new to VBA.
1) Play sound as long as the criteria are satisifed
The sound is played and looped as long as the criteria are satisfied
However a user can stop this sound manually if desired.

2) Play sound as long as the message box is not dismissed
A message box will pop up when the criteria are satisifed.
The sound is played and looped at the same time.
The sound will stop after the user has acknowledged the message by clicking on
"ok" of the message box.

3) Stop sound
How to create a code which can stop specific sounds, but not every sound which
is playing?

Thank you.

PS:
Here's the code (incomplete) for Q1-2:

Function Alarm(Cell, Condition1, Condition2, ..., Message_text) 'incomplete
Dim WAVFile As String
Const SND_ASYNC = &H1
Const SND_FILENAME = &H20000
Const SND_LOOP = &H8
On Error GoTo ProcessErr
If Evaluate(Cell.Value & Condition) Then
WAVFile = "C:\WINDOWS\Media\alert.wav"
Call PlaySound(WAVFile, 0&, SND_ASYNC Or SND_FILENAME Or SND_LOOP)
MsgBox " {Message_text}" 'incomplete
Alarm = True
Exit Function
End If

ProcessErr:
Alarm = False
End Function


--
Additional info about my computer:
- Office XP
- Windows XP Pro



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Play sound aac Excel Discussion (Misc queries) 2 December 5th 07 11:24 PM
Play Sound File Soniya[_4_] Excel Programming 0 February 22nd 06 10:46 AM
play sound when opening workbook Alen32 Excel Programming 4 April 21st 05 12:22 AM
Using Countdown in Status Bar to Play Sound Full Monty Excel Programming 5 February 6th 04 05:37 PM


All times are GMT +1. The time now is 09:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"