View Single Post
Old 05-23-2019, 10:29 AM   #33
smiler44
Newly Registered User
 
Join Date: Jul 2008
Location: UK
Posts: 637
Thanks: 13
Thanked 9 Times in 8 Posts
smiler44 is on a distinguished road
Re: get details of song being played

Quote:
Originally Posted by June7 View Post
As suggested, why don't you provide the workbook for analysis?

The FileInfo function requires file name to be passed to it as argument. Yet I don't see the function called. The sub randomlyselectsong has the file name. It sets the variable filetoplay and sends that value to the player. This is where you should put code to get the file duration, just before Shell command opening the file in player. Modify the code I provided. It can be a function with arguments or include the 3 lines of code within your procedure. Only instead of Debug.Print, set a variable.
I am just tabbing through the code to make sure what i provided was working, have you tried the code?

Are we getting out wires crossed? Ignoring the code i have provided can you help with using vba code to get the name of the song currently being played by windows media player?

smiler44

smiler44 is offline   Reply With Quote