• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
    • Password Reset
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

How to start a Music Song without the Windows request|VBA & Macros|Excel Forum|My Online Training Hub

You are here: Home / How to start a Music Song without the Windows request|VBA & Macros|Excel Forum|My Online Training Hub
Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search|Last Search Results
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumVBA & MacrosHow to start a Music Song without t…
sp_PrintTopic sp_TopicIcon
How to start a Music Song without the Windows request
Avatar
A.Maurizio
Member
Members
Level 0
Forum Posts: 202
Member Since:
June 26, 2016
sp_UserOfflineSmall Offline
1
November 28, 2018 - 3:43 am
sp_Permalink sp_Print

Hello everyone My name is Maurizio
And my problem is this:
On an Excel sheet I went to the "Insert" menu and then to "Objects"
from here I called an Audio file.
Then using this function:

(Declare Function sndPlaySound32 Lib "winmm.dll" Alias "sndPlaySoundA" _
(ByVal lpszSoundName As String, ByVal uFlags As Long) As Long

Sub StartSound ()
On Error Resume Next
Sheets ("Audio") Shapes ("Object 1"). Select
Selection.Verb Verb: = xlPrimary
End Sub)

Inserted inside a form; The call using a key inserted on the sheet; And so far everything is ok

Now my question is this:
Io When I call this function, before I start the song I get out of this Windows verification setting.
See Picture?
So I would like to know if it was possible to start the song without letting out this call of windows all here ThanksImmagine_Avvio_Brano.PNGImage Enlarger

sp_PlupAttachments Attachments
  • sp_PlupImage Immagine_Avvio_Brano.PNG (17 KB)
Avatar
Philip Treacy
Admin
Level 10
Forum Posts: 1518
Member Since:
October 5, 2010
sp_UserOfflineSmall Offline
2
November 29, 2018 - 9:41 pm
sp_Permalink sp_Print

Try unchecking the box beside this

avvisa sempre prima di aprire questo tipo di file

Avatar
A.Maurizio
Member
Members
Level 0
Forum Posts: 202
Member Since:
June 26, 2016
sp_UserOfflineSmall Offline
3
November 30, 2018 - 9:35 pm
sp_Permalink sp_Print

Hi Philip Treacy How are you?
Excuse me so much For asking such an obvious thing
But I think it's due to the tiredness or distraction, as I had not really seen that Postilla to select Graziecone always endless for your help ..

But I can dare to ask in addition if there was the possibility of starting the piece of music; Without Open the Audio application.

Let me explain: If you notice, when you make the execution request to start the Song in question or desired; Pressing a key on the sheet!
Normally to me having Windows 10 as the operating system opens the classic screen of (Groove Music) that then and that application that took the place of the old (Media Player) For here: That said, there would be no possibility exploiting the VBA of simply hear the sound file without opening (Groove Music) Windows.
I tried to change the Windows API but I could not get anything.
Thank you Infinite Sincere Greetings from A.Maurizio

 

I add the test file

Avatar
Philip Treacy
Admin
Level 10
Forum Posts: 1518
Member Since:
October 5, 2010
sp_UserOfflineSmall Offline
4
December 11, 2018 - 1:55 pm
sp_Permalink sp_Print sp_EditHistory

Hi Maurizio,

I have to ask, why are you playing music in Excel?  Why not just use a media player?

Anyway, you can use ActiveX controls to do what you want - see attached workbook.

From the Developer tab choose More Controls from the ActiveX Controls and then scroll down to insert Windows Media Player.

Then insert an ActiveX Command Button.

All of this is already done in the workbook.

A1 contains the path to the media (it will play audio and video), and A2 onwards contains the full name of the file including the extension.

You will of course have to change these to match your own PC.

The VBA code that controls all of this is in the Sheet1 module.

An alternative to having a list of songs on the sheet is to create a playlist for Windows Media Player and then load that.

Cheers

Phil

Avatar
SunnyKow
Puchong, Malaysia

VIP
Members


Trusted Members
Level 8
Forum Posts: 1432
Member Since:
June 25, 2016
sp_UserOfflineSmall Offline
5
December 11, 2018 - 2:25 pm
sp_Permalink sp_Print

Hi Maurizio

You can also have a look at these two links to see if they help:

https://www.myonlinetraininghu.....xcel#p1540

https://www.myonlinetraininghu.....shed#p6103

Sunny

Avatar
A.Maurizio
Member
Members
Level 0
Forum Posts: 202
Member Since:
June 26, 2016
sp_UserOfflineSmall Offline
6
December 11, 2018 - 7:08 pm
sp_Permalink sp_Print

Hi Philip Treacy
Thank you for your intervention on the topic Play List.
Although to be honest it was not preato to make listen to music simply taken from the pc; But it wanted to be simply a form of Functionality to call a piece of music when the hour (X) of my Matt Alarm was popped.
Having said this: Your work is very beautiful; Even to tell the truth I had already developed a few years ago with both the VBA and the VB6.
Maio: I created this thing just like that, because in doing so I'm not forced to keep a folder always inside my workbook.
In addition, since almost always I transfer my best projects thanks to your help; In the Laptop PC
in your case I should refer to the procedure I use the Function (ThisWorkbook.Path & "\ utility \") To always have everything available.
Finally: In your case the weight of your folder would become noticeable in terms of GB in the case of a (Download)
In my case and definitely a lot less Heavy everything here.
Anyway Thanks again for everything.
Sincere greetings from A.Maurizio

Avatar
A.Maurizio
Member
Members
Level 0
Forum Posts: 202
Member Since:
June 26, 2016
sp_UserOfflineSmall Offline
7
December 11, 2018 - 7:26 pm
sp_Permalink sp_Print

Hi SunnyKow
Thank you for offering me your links to study and create the PIVOT masks
Yes, as you rightly said, you always knew that these Pivots are very powerful as a form of communication between the sheet of excel / vba and the formulas.
But: It will be because the years that were, I spent a lot of time learning to work well with (Access) as my teacher who at the time taught how to work on the computer.
He always said that: He would explain most of the office package to us, but it would not go into detail as far as the program was concerned, as it would have been all the time, because it was difficult to understand; Especially then when it would be a matter of studying the languages ​​(SQL) to develop the queries etc ...!
For that moment I have done nothing but study only and exclusively (Access)
All this just to explain the reason for so many things including the (PIVOT) I do not even know where to start.
But now thanks to these your links, I'll definitely try.
Thanks Infinite and Good Day

Avatar
SunnyKow
Puchong, Malaysia

VIP
Members


Trusted Members
Level 8
Forum Posts: 1432
Member Since:
June 25, 2016
sp_UserOfflineSmall Offline
8
December 12, 2018 - 10:41 am
sp_Permalink sp_Print

Hi Maurizio

Thanks for your lengthy explanation Laugh

It doesn't matter whichever method you chose. Achieving the desired result is the most important.

Good luck in your quest to give Pivot Table a try.

Sunny

Avatar
A.Maurizio
Member
Members
Level 0
Forum Posts: 202
Member Since:
June 26, 2016
sp_UserOfflineSmall Offline
9
December 12, 2018 - 6:09 pm
sp_Permalink sp_Print

Thank you all
Hello and to the next

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online:
Guest(s) 9
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 871
Purfleet: 412
Frans Visser: 346
David_Ng: 306
lea cohen: 219
Jessica Stewart: 205
A.Maurizio: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
stuart burge
Bruce Tang Nian
Scot C
Othman AL MUTAIRI
Misael Gutierrez Sr.
Attif Ihsan
Kieran Fee
Murat Hasanoglu
Brett Dryland
Saeed Aldousari
Forum Stats:
Groups: 3
Forums: 24
Topics: 6223
Posts: 27295

 

Member Stats:
Guest Posters: 49
Members: 31920
Moderators: 3
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: MOTH Support, Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook
 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate

Support

  • Contact
  • Forum
  • Helpdesk - For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.