Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 10-10-2014, 11:59 AM
blackjack blackjack is offline Conditionally playing a wave file Windows 7 64bit Conditionally playing a wave file Office 2007
Novice
Conditionally playing a wave file
 
Join Date: Sep 2014
Posts: 13
blackjack is on a distinguished road
Default Conditionally playing a wave file

This is the code I'm trying to use but I'm getting nothing. I'd prefer to set the path to
C:\Users\X\Music\WWE\



Basically whenever M2>0 I'd like the wav file to play.

(This is set in Sheet Tab- View Code Declarations)
Private Declare Function PlaySound Lib "winmm.dll" _
Alias "PlaySoundA" (ByVal lpszName As String, _
ByVal hModule As Long, ByVal dwFlags As Long) As Long
Const SND_SYNC = &H0
Const SND_ASYNC = &H1
Const SND_FILENAME = &H20000

(This part was in a combined PlayWav)
Sub PlayWAV()
WavFile = ThisWorkbook.Path & "\BoDallasA.wav"
Call PlaySound(WavFile, 0&, SND_ASYNC Or SND_FILENAME)
End Sub

Private Sub Worksheet_Change(ByVal Target As Range)
Threshold = 0
If Range("M2").Value > Threshold Then PlayWAV
End Sub
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert a text conditionally deboer Word 1 05-04-2014 03:35 PM
Conditionally playing a wave file changing font size conditionally newton.rogers Excel 1 03-18-2014 12:57 PM
Conditionally playing a wave file How to conditionally format this? g4tv4life Excel 2 03-13-2014 10:58 AM
Macro to conditionally create or go to worksheet Reinaldo123 Excel Programming 1 07-06-2012 07:23 AM
PPT not playing full music file gprcinstructor PowerPoint 1 09-15-2010 11:08 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:20 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft