View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Michel[_3_] Michel[_3_] is offline
external usenet poster
 
Posts: 23
Default How BEEP on internal speakers, not on sound-card?

thanks for these answers,
So there isn't any way to beep the internal speaker of the PC from
within Excel-VBA if you have win98 ?!
:-(

"Harald Staff" wrote in message ...
Hi

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

--
HTH. Best wishes Harald
Followup to newsgroup only please.