Trigger music if...
Solved
irettigam
-
via55 Posted messages 14392 Registration date Status Member Last intervention -
via55 Posted messages 14392 Registration date Status Member Last intervention -
Hello
How to write a macro that would trigger a music or recorded message
for example: if a<>b a recorded message triggers otherwise nothing
I'm on mac
Thanks to all
How to write a macro that would trigger a music or recorded message
for example: if a<>b a recorded message triggers otherwise nothing
I'm on mac
Thanks to all
4 answers
-
Hi Via,
It is possible that it works with ITUNES, that the requester takes up my previous post and following the explained procedure draws the player on a sheet.
If Excel does not crash there is hope, otherwise it will be necessary to go through the Windows Media Player download for Mac
--
A+
Mike-31
A period of failure is a perfect time to sow the seeds of knowledge. -
Hello
1° Create a WindowsMediaPlayer object on sheet 1 (Developer tab - Insert - ActiveX Controls - Other controls (icon with tools) - Choose WindowsMediaPlayer from the list and place it on the sheet
2° Create a macro that plays the music
ALT+F11 to open the VBA editor then Insert - Module - Copy-paste the following macro:
Sub music() Sheets(1).WindowsMediaPlayer1.URL = "C:\Users\Public\Music\Sample Music\Kalimba.mp3" End Sub
Modify the path according to your music file
3° Create a macro that triggers the music macro when a <> b
For example, if a is in A1 of sheet1 and b is in B1, place a macro of this style in the worksheet of the sheet (Open the VBA editor and double-click on the sheet in the tree to open the page where you can paste the macroPrivate Sub Worksheet_Change(ByVal Target As Range) If Range("A1") <> Range("B1") Then music End Sub
Each time A1 or B1 changes, the macro will trigger if the values are different
Best regards
Via
--
"Imagination is more important than knowledge." A. Einstein -
Good evening,
Look at this discussion at the end of the conversation you will find the triggering modes and the code
https://forums.commentcamarche.net/forum/affich-32151851-creer-une-macro-pour-declencher-clignotement-de-cellules?page=2
--
See you
Mike-31
A period of failure is a perfect time to sow the seeds of knowledge. -
Re,
You can download from this link
https://www.commentcamarche.net/telecharger/tv-video/23977-windows-media-player/
but first check if your player is in the list of controls. To do this, open your Excel/developer tab/control module/icon Insert and at the bottom right, you should see an icon represented by a wrench and a crossed hammer on 3 points. Click on it and it will open a list of controls where you should find your media player.
If you find it, click on it and draw it on your sheet by left-clicking your mouse.
Then in design mode, when you click on the player you have drawn, its name will appear in the address bar. Please give us this name
A+
Mike-31
A period of failure is a perfect time to sow the seeds of knowledge.-
- Hello
Read my first message again:
(Developer tab - Insert - ActiveX Controls - Other Controls (icon with tools) - Choose the audio player from the list and place it in the sheet
Look in the name box for the name assigned to the player
Replace in the music macro that I mentioned WindowsMediaPlayer1 with the name of your player
If it doesn't work, you need to download Windows Media Player for Mac as Mike mentioned in his last message.
-