Ich habe folgendes Problem:
Ich will in Excel einen Jingle automatisch abspielen lassen, sobald sich ein bestimmter Zellwert verändert.
Wie kann ich das Problem lösen?
Danke schonmal!!!
'----------------------------------------------------------
'in die Tabellendekleration
'Zelle A1 muß Wert 34 haben
Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim tb As Worksheet
Set tb = Worksheets("Tabelle1")
On Error GoTo Fehler
Application.EnableEvents = False
If Target.Address = "$A$1" Then
If IsNumeric(tb.[A1].Value) Then 'Abfrage, ob Zahl
If tb.[A1] = 34 Then Call Modul1.Musik
End If
End If
Application.EnableEvents = True
Exit Sub
Fehler:
Application.EnableEvents = True
End Sub
'----------------------------------------------------------
'----------------------------------------------------------
'in ein Modul
Declare Function sndPlaySound32 Lib "winmm.dll" _
Alias "sndPlaySoundA" (ByVal lpszSoundName _
As String, ByVal uFlags As Long) As Long
Sub Musik()
MsgBox "richtiger Wert"
Call sndPlaySound32("c:\WINNT\media\ding.wav", 1)
End Sub
'----------------------------------------------------------