Thread: Sound Code
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
bob bob is offline
external usenet poster
 
Posts: 12
Default Sound Code

This doesn,t work. And have no idea how to make it work. Can you help

Private Sub CommandButton1_Click(
Sheets("Forecast").Selec
Sheets("Forecast").Range("A1").Selec

Private Declare Function PlaySound Lib "winmm.dll"
Alias "PlaySoundA" (ByVal lpszName As String,
ByVal hModule As Long, ByVal dwFlags As Long) As Lon

Const SND_SYNC = &H
Const SND_ASYNC = &H
Const SND_FILENAME = &H2000

Sub PlayWAV(
WAVFile = "dooropen.wav
WAVFile = ThisWorkbook.Path & "\" & WAVFil
Call PlaySound(WAVFile, 0&, SND_ASYNC Or SND_FILENAME
End Sub