Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 71
Default How do I add sound alerts to Excel spreadsheets?

Jim is there a way to accomplish the same in Excel 2003. The play commands
have been disabled.

"Jim Thomlinson" wrote:

Here is some code for playing a beep or a wave file...

Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" _
(ByVal lpszName As String, hModule As Long, ByVal dwFlags As Long) As Long

Private Declare Function Beep Lib "kernel32" (ByVal dwFreq As Long, ByVal
dwDuration _
As Long) As Long


Private Sub PlayMySound()
PlayWavFile "C:\Windows\Media\Microsoft Office 2000\Chimes.wav"
End Sub

Public Function PlayWavFile(WavFile As String) As String
Const SND_ASYNC = &H1
Const SND_FILENAME = &H20000
PlaySound WavFile, 0, SND_ASYNC Or SND_FILENAME
PlayWavFile = ""
End Function


Sub Beep1()
Dim num As Single
Dim num1 As Long
Dim numLoops As Single

num = 10
NumSeconds = 4 '<== duration
numLoops = (NumSeconds * num * 2) / 2
If numLoops < 1 Then
numLoops = 1
End If
num1 = 1000 / (num * 2)

For i = 1 To numLoops
'DoEvents
Beep 500, num1
'DoEvents
Beep 10000, num1
'DoEvents
Next
End Sub
--
HTH...

Jim Thomlinson


"identijoe" wrote:

I want to alert users fo input errors using a barcode scanner to enter
container numbers into a spreadsheet. Entering non-matching numbers (two
different barcodes) need to envoke an "alert" sound.

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
Automatic alerts in excel PK Excel Discussion (Misc queries) 3 April 26th 08 04:57 PM
How Excel VBA corporate with MSN Alerts? jazzcarr Excel Discussion (Misc queries) 0 January 1st 08 12:37 PM
How do I set up Alerts and Notification on Excel? Turtle Excel Discussion (Misc queries) 1 November 14th 07 09:24 PM
how do i set up sound alerts on excel? Anuj Dhamija Excel Discussion (Misc queries) 1 May 19th 06 02:26 PM
Help!!! Alerts in Excel!! jepoy_02 Excel Programming 3 June 20th 05 11:21 AM


All times are GMT +1. The time now is 10:39 AM.

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

About Us

"It's about Microsoft Excel"