Something I played around with years and years ago - kind of got it working, sorry I can not locate the xls I have all the testing in
jiuk
Code
Option Explicit
Const VK_VOLUME_MUTE = &HAD
Const VK_VOLUME_DOWN = &HAE
Const VK_VOLUME_UP = &HAF
#If VBA7 Then
Private Declare PtrSafe Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
#Else
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
#End If
Sub My_Turn_The_Volume_UP()
Call Turn_The_Volume_UP
End Sub
Sub My_Turn_The_VOLUME_DOWN()
Call Turn_The_Volume_DOWN
End Sub
Sub myVOLUME_MUTE()
Call Volume_MUTE
End Sub
Sub Turn_The_Volume_UP()
keybd_event VK_VOLUME_UP, 0, 1, 0
keybd_event VK_VOLUME_UP, 0, 3, 0
End Sub
Sub Turn_The_Volume_DOWN()
keybd_event VK_VOLUME_DOWN, 0, 1, 0
keybd_event VK_VOLUME_DOWN, 0, 3, 0
End Sub
Sub Volume_MUTE()
keybd_event VK_VOLUME_MUTE, 0, 1, 0
End Sub
Display More