Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Beeps other than beep?

5 views
Skip to first unread message

Ray

unread,
Jun 6, 1999, 3:00:00 AM6/6/99
to
Hi all.
I'm trying to get some beeps to occur. I can get the standard beep,
no problem. But, I know computers are capable of more than one beep,
i.e. the CapsLock beep if you have the beep enabled. I have the
following code:

Option Explicit

Declare Function MessageBeep Lib "user32" (ByVal wType As Long) As
Long
_______________________________________

Const MB_ICH = &H10&
Const MB_IC = &H10&
Const MB_IQ = &H20&
Const MB_IE = &H30&
Const MB_IA = &H40&
Const MB_IINFO = &H40&
________________________________________

Sub messagebeeptest()

Sub messagebeeptest()

MessageBeep MB_ICH
MessageBeep MB_IQ
MessageBeep MB_IE
MessageBeep MB_IA
MessageBeep MB_IINFO


End Sub


aLL BEEPS are the same, I've tried messing around with the &H&
values, but it's the same always regardless. Anyone know how? And
note, it's just beeps. Nothing that involves the use of a soundcard.
Thanks a lot.


Ray in PA
Excel97 WinNT4.0

Thomas Ogilvy

unread,
Jun 6, 1999, 3:00:00 AM6/6/99
to
Try the beep function

Sub Beeper()
dim i as integer, j as long
For i = 1 To 3
Beep
For j = 1 To 1000000
Next j
DoEvents
Next
End Sub

Regards,
Tom Ogilvy


Ray wrote in message <375ac125...@msnews.microsoft.com>...

Dana DeLouis

unread,
Jun 7, 1999, 3:00:00 AM6/7/99
to
Hi Tom & Ray. I am just curious. I have never gotten Excel's VB function
'Beep' to work on my computer. It never worked in Excel 97, and still does
not work in Excel 2k beta. I gave up on this a long time ago and forgot all
about it. I know the hardware is ok because other programs can get the
speaker to beep.
Thanks to Ray's MessageBeep function, I now have a custom function that can
cause a 'Beep.'
I am just curious, does anyone else have a problem with VB's Beep function
not working? I have a feeling that this time it really is only me.
Thanks.

Now I can get Excel VB to Beep with:


Declare Function MessageBeep Lib "user32" (ByVal wType As Long) As Long

Sub Beep2()
MessageBeep &H40&
End Sub


Thomas Ogilvy

unread,
Jun 7, 1999, 3:00:00 AM6/7/99
to
Dana,
They both work for me. Your code makes the sound associated with the
Asterick in control panel sound.

The beep makes the sound associated with Default sound in the control panel
sound.

These are not definitive because I have some duplicate assignments, but I
believe these are the associations.

Regards,
Tom Ogilvy

Dana DeLouis wrote in message <#yP0GOPs#GA....@cppssbbsa02.microsoft.com>...

David McRitchie

unread,
Jun 8, 1999, 3:00:00 AM6/8/99
to
Hi Tom and Ray,

I shudder when I see timing done with a loop to waste machine cycles, on a
mainframe that would be about 30 years behind the times. Anyway I think the
code I have below will work better across platforms and more to the point
with processors with different speeds. Mine is XL95 running WinNT 4.0
Workstation on a Pentium II Pro.

Excel does not have a SLEEP function so you have to calculate the time at
which you will resume. I give a little more time after first beep.

Sub Beeper()
Beep
start2 = Now() + TimeSerial(0, 0, 0.9)
Application.Wait start2
For i = 2 To 3
start2 = Now() + TimeSerial(0, 0, 0.8)
Application.Wait start2
Beep
Next i
End Sub

Even using WAIT according to HELP you may still be suspending other
processing.

HTH, You can decrease or increase the 3 for fewer or additional beeps.
David McRitchie
My Excel Pages: http://members.aol.com/dmcritchie/excel/excel.htm
Index: http://members.aol.com/dmcritchie/excel/xlindex.htm


In article <e8IgeNJs#GA....@cppssbbsa02.microsoft.com>,


"Thomas Ogilvy" <twog...@email.msn.com> wrote:
> Try the beep function
>
> Sub Beeper()
> dim i as integer, j as long
> For i = 1 To 3
> Beep
> For j = 1 To 1000000
> Next j
> DoEvents
> Next
> End Sub
>
> Regards,
> Tom Ogilvy
>
> Ray wrote in message <375ac125...@msnews.microsoft.com>...
> >Hi all.
> >I'm trying to get some beeps to occur. I can get the standard beep,
> >no problem. But, I know computers are capable of more than one beep,

[clipped]


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.

Torsten J. Schrimpf

unread,
Jun 8, 1999, 3:00:00 AM6/8/99
to
Hi out there

Does anybody have a list of the hex beep codes defined in Lib
"user32"?

regards

Torsten.

Thomas Jansen

unread,
Jun 8, 1999, 3:00:00 AM6/8/99
to
Hi Torsten,

the help on MessageBeep describes the parameter as ...

0xFFFFFFFF (Standard beep using the computer speaker)
MB_ICONASTERISK (SystemAsterisk)
MB_ICONEXCLAMATION (SystemExclamation)
MB_ICONHAND (SystemHand)
MB_ICONQUESTION (SystemQuestion)
MB_OK (SystemDefault)


The file Winuser.h says ...

#define MB_OK 0x00000000L
#define MB_ICONHAND 0x00000010L
#define MB_ICONQUESTION 0x00000020L
#define MB_ICONEXCLAMATION 0x00000030L
#define MB_ICONASTERISK 0x00000040L


Greetings from Bavaria, Tommy


Torsten J. Schrimpf schrieb in Nachricht
<375cd315...@194.77.111.19>...

0 new messages