Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default I want to *beep* *beep*!!!!

Hi Rob,

Application.Wait won't give you the precision you need to space out your
beeps. You could use the Sleep API function:

Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Sub MultiBeep(NumBeeps As Integer)
Dim Counter As Integer

For Counter = 1 To NumBeeps
Interaction.Beep
Sleep 200
Next Counter
End Sub


--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]


Rob wrote:
This only beeps once. I think I need to add in a line like
application.wait or something, but that didn't work, so does anyone
know what I should do? Thanks. Have a good Weekend.
Rob

Sub MultiBeep(NumBeeps)
Dim Counter
For Counter = 1 To NumBeeps
Beep
Next
End Sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 691
Default I want to *beep* *beep*!!!!

You might consider using a .wav file instead.

'Related material on sound can be found at John Walkenbach's
' Tip 59 Playing Sound From Excel
' http://www.j-walk.com/ss/excel/tips/tip59.htm

Option Explicit
' Declare Function sndPlaySound32 Lib "c:\winnt\system32\winmm.dll" _'
Declare Function sndPlaySound32 Lib "winmm.dll" _
Alias "sndPlaySoundA" (ByVal lpszSoundName As String, _
ByVal uFlags As Long) As Long
'can be called from a worksheet subroutine

Sub Double_beep()
Call sndPlaySound32("c:\i386\ringout.wav", 0)
End Sub

' Example of an Event Macro -- you will need to make playvalue100 in
' a regular module
' Option Explicit
' Private Sub Worksheet_SelectionChange(ByVal Target As Range)
' If Target.Address(0, 0) = "A1" And Target.Value = 100 Then
' playvalue100
' End If
' End Sub


For something interesting like playing every .wav file on your system
see http://www.mvps.org/dmcritchie/excel/code/beeps.txt
http://www.mvps.org/dmcritchie/excel/funstuff.htm



--
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Jake Marx" wrote in message ...
Hi Rob,

Application.Wait won't give you the precision you need to space out your
beeps. You could use the Sleep API function:

Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Sub MultiBeep(NumBeeps As Integer)
Dim Counter As Integer

For Counter = 1 To NumBeeps
Interaction.Beep
Sleep 200
Next Counter
End Sub


--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]


Rob wrote:
This only beeps once. I think I need to add in a line like
application.wait or something, but that didn't work, so does anyone
know what I should do? Thanks. Have a good Weekend.
Rob

Sub MultiBeep(NumBeeps)
Dim Counter
For Counter = 1 To NumBeeps
Beep
Next
End Sub




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
Beep on greater than zero TaylorLeigh New Users to Excel 1 September 29th 08 11:14 PM
BEEP ziad Excel Discussion (Misc queries) 5 December 28th 07 03:56 PM
turn off beep jocke Excel Discussion (Misc queries) 0 May 31st 06 07:54 AM
I want to *beep* *beep*!!!! KJTFS[_105_] Excel Programming 0 February 20th 04 02:59 PM
Displaying a Message and a Beep ZAK Excel Programming 1 November 11th 03 11:10 AM


All times are GMT +1. The time now is 04:10 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"