beep suddenly won't work

J

Jack Sons

Hi all,

Suddenly my Excel (2K) beep won't work anymore, neither in excisting code
nor in new code. For instance the code below does nothing.

Sub Macro6()
Beep
Beep
Beep
End Sub

All other Windows (XP SP) sounds still work, but I'm not sure of Word
because as far as I can remember I don't do things in Word that generate
sound. I tried the macro below and there was no sound.

Sub test_sound()
Beep
End Sub

Where should I look for what is wrong? Your help will be appreciated.

Jack Sons
The Netherlands
 
D

Don Guillett

Is your speaker card turned on? Or you could use this for your internal
speaker.

A search on this
http://makeashorterlink.com/?D24E42426
showed among lots of things this:


" In VB, the Beep function calls the Windows Exclamation sound, so if you
have a sound card driver installed, the sound will be emitted by the
sound card.


" If your app is being run under WinNT4, Win2000, or WinXP, you can use the
Beep API function to play a sound using the internal speaker. Win9x does
not support this (like VB's Beep statement, the Beep API function under
Win9x only plays the Default Sound .wav file).


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


Sub BeepMe()


Dim frequency As Long
Dim duration As Long


frequency = 1600
duration = 500


Call Beep(frequency, duration)


End Sub
 
J

Jack Sons

Don,

The internal sound is barely audible and not a good substitute for the
standard beep.

In Control Panel -- Sounds -- Windows -- Exclamation mark I sea the speaker
symbol in front of it. In the drop down box below "Sounds:" I see "Windows
XP Explanation.wav and when I click the horizontal arrow at the right hand
side I hear the proper sound coming out of my speakers. So my speaker card
is turned on and in principle the exitation of the Windows Explanation sound
works. Other souds also work well, like for incoming mail, starting Windows
etc.

I tried (from the Excel help function):

Sub beepsound()
Dim I
For I = 1 To 3
Beep
Next I
End Sub

but I get an errormessage saying (translated from Dutch)
"Compiling error. The argument is not optional".
I have absolutely no inea what this means.

You wrote: "In VB, the Beep function calls the Windows Exclamation sound".
Where is the connection, could that be disrupted somewhere?

Can you help?

Jack.
 
J

Jack Sons

Don,

BTW, what is an API function?

Jack.

Don Guillett said:
Is your speaker card turned on? Or you could use this for your internal
speaker.

A search on this
http://makeashorterlink.com/?D24E42426
showed among lots of things this:


" In VB, the Beep function calls the Windows Exclamation sound, so if you
have a sound card driver installed, the sound will be emitted by the
sound card.


" If your app is being run under WinNT4, Win2000, or WinXP, you can use
the
Beep API function to play a sound using the internal speaker. Win9x does
not support this (like VB's Beep statement, the Beep API function under
Win9x only plays the Default Sound .wav file).


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


Sub BeepMe()


Dim frequency As Long
Dim duration As Long


frequency = 1600
duration = 500


Call Beep(frequency, duration)


End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top