Hallo Zusammen,
ich würde gerne am Ende des Makros den WindowsMedia Player schließen. Habt Ihre eine Idee wie ich das einbinden kann?
Public Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As Long
Sub Intro()
Dim basepath As String
Dim audiofile As String
Dim full_filename As String
basepath = "c:\users\Desktop"
audiofile = "test.mp3"
full_filename = basepath & "\test.mp3"
Debug.Print full_filename
Application.ScreenUpdating = False
On Error Resume Next
ActiveSheet.OLEObjects.Add(Filename:=full_filename, Link:=True).Select
If Err.Number <> 0 Then
MsgBox "Could not play " & ActiveCell.Text
Exit Sub
End If
Selection.Verb
Selection.Delete
SetForegroundWindow (Application.hwnd)
Application.WindowState = xlMaximized
Application.ScreenUpdating = True |