Macro to control EXCEL sheet volume on windows 7 mixer panel

hotspot1972

New Member
Joined
Jul 9, 2020
Messages
16
Office Version
  1. 2013
Platform
  1. Windows
Hi Everyone
i really need help ,
i want a macro to call upon opening my workbook to set maximum volume .
i have this and it works:
Sub MaximumVolume()
Dim i As Integer
For i = 1 To 100
Call VolUp
Next i
End Sub

when i say it work - its sets the "device speakers to 100%"
However - what im finding is when you open the volume mixer panel - the excel sheet is showing muted. I need this to be unmuted and 100% volume upon opening.
seen here below as ulf throughput tool17012021

Capture.PNG
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
VBA Code:
Public Declare PtrSafe Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)

Const VK_VOLUME_MUTE = &HAD

Sub VolToggle()
   keybd_event VK_VOLUME_MUTE, 0, 1, 0
End Sub
 
Upvote 0
unfortunately getting the Mute Status is awfully complex. if you are up for it, see this post
 
Upvote 0
Many thanks.
This works in toggling the mutes - can we add volume at 100%
 
Upvote 0
you already have 100% volume and as discussed in the link, it toggles but it is hard to find out which state it is in.
 
Upvote 0
you already have 100% volume and as discussed in the link, it toggles but it is hard to find out which state it is in.
Thanks diddi. The toggle works, but not if the excel application has been manually muted. The issue I have is operators muting my sheet when I'm trying to alert them to a problem :)
I need a way, that when I have an alarm state - the maximum volume is called (which is what I have) but also it sets the maximum volume on the excel application part (and unmute) on the volume mixer panel.
I read that link you sent,scratched my head and made a coffee :)
I'm running Windows 7 64bit, Office 2013.
 
Upvote 0
you need that head scratching link to do that and another coffee
 
Upvote 0

Forum statistics

Threads
1,215,430
Messages
6,124,850
Members
449,194
Latest member
HellScout

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top