Gruppe
Ereignis
Problem
Bei Doppelklick auf einen Dateinamen in Spalte A soll die dort genannte WAV-Datei abgespielt werden.
ClassModule: Tabelle1
Private Sub Worksheet_BeforeDoubleClick( _
ByVal Target As Range, Cancel As Boolean)
If Target.Column <> 1 Then Exit Sub
If IsEmpty(Target) Then Exit Sub
Cancel = True
If Dir(Target.Value) = "" Then
Beep
MsgBox "WAV-Datei wurde nicht gefunden!"
Exit Sub
End If
Call sndPlaySound32(Target.Value, 1)
End Sub
StandardModule: basMain
Declare Function sndPlaySound32 Lib "winmm.dll" _
Alias "sndPlaySoundA" (ByVal lpszSoundName _
As String, ByVal uFlags As Long) As Long