軟體:EXCEL
版本:2013
使用巨集當達成條件時播放音效
Private Declare Function PlayWaveSound Lib "winmm.dll" Alias "sndPlaySoundA"
(ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Public Sub sound()
Dim soundName As String
soundName = "C:\WINDOWS\Media\Windows 燦爛.wav"
'指定音效檔
PlayWaveSound soundName, 0
End Sub
以上是語法 雖然會發出聲音 但永遠是出現
C:\WINDOWS\Media\Windows 叮咚.wav
這個聲音
無論語法路徑如何修改音效都不會跟著變