Playsound stops when another macro pressed

txgent72

New Member
Joined
Mar 13, 2018
Messages
6
Hello, I have an invoicing/ accounting program virtually complete. My eccentric guest asked for a jukebox with songs to play in a loop in the background while doing other tasks, which is mostly clicking macros to process data.
Trouble is, whenever another non-music macro is clicked, the music loop then stops.
Is there a way to keep the music going AND allow the calculation macro to work?
Thanks
Chris
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Hello, I have an invoicing/ accounting program virtually complete. My eccentric guest asked for a jukebox with songs to play in a loop in the background while doing other tasks, which is mostly clicking macros to process data.
Trouble is, whenever another non-music macro is clicked, the music loop then stops.
Is there a way to keep the music going AND allow the calculation macro to work?
Thanks
Chris
If you're not already aware; the VBA command:
VBA Code:
Application.Run "Macro_Name"
Can be placed at the end of your initial macro which will call the next macro; this should facilitate the guest not having to click macros to process data.
With regard to sndPlaySoundA method; I am not sure if aforementioned command will stop the music loop.
 
Last edited:
Upvote 0
Thank you for your reply, however, the workbook tabs have multiple macros each for my customer to press depending on which step they are working on in the invoice tab or data entry tab or accounting tabs.

It's not automatic because they enter transaction information over a period of a month to build the database. The system has no way of knowing when a user is ready for processing whatever macro to perform.

If I wanted something automatic I would just call a Function. I will include some screenshots to show sample code below:
 

Attachments

  • Module1a.png
    Module1a.png
    46.8 KB · Views: 4
  • Module1b.png
    Module1b.png
    74.9 KB · Views: 4
  • data menu.png
    data menu.png
    62.5 KB · Views: 3
  • jukebox menu.png
    jukebox menu.png
    18.8 KB · Views: 4
Upvote 0
Hello, I have an invoicing/ accounting program virtually complete. My eccentric guest asked for a jukebox with songs to play in a loop in the background while doing other tasks, which is mostly clicking macros to process data.
Trouble is, whenever another non-music macro is clicked, the music loop then stops.
Is there a way to keep the music going AND allow the calculation macro to work?
Thanks
Chris
If user starts the program and turns on a song, it works great. They can listen to the song, but the second a button is pressed anywhere, even an excel button, the wav file stops and they have to go back to start it again or pick a new song. This is the last hurtle before release to my client.
I sincerely appreciate any help!
 
Upvote 0
The specific problem seems to be the scroll bar.

When I use the scroll bar, my macro to play the backround "elevator" music stops.

I don't understand why and it's really annoying.
 
Upvote 0

Forum statistics

Threads
1,214,805
Messages
6,121,664
Members
449,045
Latest member
Marcus05

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