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
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>...
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
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>...
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.
Does anybody have a list of the hex beep codes defined in Lib
"user32"?
regards
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>...