• 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

Change WindowsMediaPlayer mode, when file played is finished|VBA & Macros|Excel Forum|My Online Training Hub

You are here: Home / Change WindowsMediaPlayer mode, when file played is finished|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 & MacrosChange WindowsMediaPlayer mode, whe…
sp_PrintTopic sp_TopicIcon
Change WindowsMediaPlayer mode, when file played is finished
Avatar
Victor Boaglio
Member
Members
Level 0
Forum Posts: 9
Member Since:
August 13, 2018
sp_UserOfflineSmall Offline
1
August 13, 2018 - 2:10 pm
sp_Permalink sp_Print sp_EditHistory

I am creating a learning system for children with cards that have an animal and a bar code. The idea is to play an initial video, in LOOP, asking the child to choose a card and pass it through the reader. Then, the system shows you a video of that animal, and returns to the initial video, again in LOOP, waiting for a new card. On Sheet1, I have column A with the barcodes, and column B with the file names. The system searches in col The code entered with the bar code, and plays the file in column B

So far, when I open the excel, start the initial video in LOOP, place the cursor in the combobox, and when reading a card, play the corresponding video, empty the combobox and reposition the cursor in the combobox What I do not achieve Do that at the end of it, replay the initial video in LOOP.

Another option i think is to work with 2 wmp. One for the permanent looping video and another for the interactive video, playing it over the permanent loop wmp player, and closing it when the play finish.

From now on, thanks for your help

Avatar
Philip Treacy
Admin
Level 10
Forum Posts: 1513
Member Since:
October 5, 2010
sp_UserOfflineSmall Offline
2
August 13, 2018 - 2:34 pm
sp_Permalink sp_Print

Hi Victor,

Can you please attach a sample workbook with the code in it.

Regards

Phil

Avatar
Philip Treacy
Admin
Level 10
Forum Posts: 1513
Member Since:
October 5, 2010
sp_UserOfflineSmall Offline
3
August 13, 2018 - 2:36 pm
sp_Permalink sp_Print

I feel this might be easier to do if written in a browser rather than Excel?

Avatar
Victor Boaglio
Member
Members
Level 0
Forum Posts: 9
Member Since:
August 13, 2018
sp_UserOfflineSmall Offline
4
August 13, 2018 - 2:49 pm
sp_Permalink sp_Print

Hi Philip, thanks for your fast reply. Here is uploaded the file
rockola.xlsx.xlsm

Avatar
Victor Boaglio
Member
Members
Level 0
Forum Posts: 9
Member Since:
August 13, 2018
sp_UserOfflineSmall Offline
5
August 13, 2018 - 3:23 pm
sp_Permalink sp_Print

About your comment "I feel this might be easier to do if written in a browser rather than Excel?"

I have chosen to use excel because the file list in Sheet1 and the mp4 files can be easily edited by any teacher without need programming knows.

Thanks again

Victor

Avatar
SunnyKow
Puchong, Malaysia

VIP
Members


Trusted Members
Level 8
Forum Posts: 1432
Member Since:
June 25, 2016
sp_UserOfflineSmall Offline
6
August 14, 2018 - 2:37 am
sp_Permalink sp_Print sp_EditHistory

Hi Victor

Give this a try.

You will need to adjust the codes to suit your needs.

Hope this helps.

Sunny

Avatar
Victor Boaglio
Member
Members
Level 0
Forum Posts: 9
Member Since:
August 13, 2018
sp_UserOfflineSmall Offline
7
August 14, 2018 - 12:59 pm
sp_Permalink sp_Print

Great job Sunny!!! tomorrow I will dedicate myself to work to adapt it exactly to what I need, but with just testing it, and some small modifications that I made, I think it is the just help I needed.Change the "LOOP" mode according to the file that is played, and creating a playlist ... when I get it ready, I'll comment again. (I'm going to sleep, in Argentina, it's 00: 00hs.) Thank you very much!

Avatar
SunnyKow
Puchong, Malaysia

VIP
Members


Trusted Members
Level 8
Forum Posts: 1432
Member Since:
June 25, 2016
sp_UserOfflineSmall Offline
8
August 15, 2018 - 1:05 pm
sp_Permalink sp_Print

You can also refer here for another topic on WMP.

https://www.myonlinetraininghu.....t-in-excel

Avatar
Victor Boaglio
Member
Members
Level 0
Forum Posts: 9
Member Since:
August 13, 2018
sp_UserOfflineSmall Offline
9
August 16, 2018 - 1:48 am
sp_Permalink sp_Print

Hi SunnyKow!! The code already works correctly! I deeply appreciate the quick and careful response.
The next step i´ll do is to try to remove the caption and the close buton to the userform.
Regards
Victor

Avatar
SunnyKow
Puchong, Malaysia

VIP
Members


Trusted Members
Level 8
Forum Posts: 1432
Member Since:
June 25, 2016
sp_UserOfflineSmall Offline
10
August 16, 2018 - 9:19 am
sp_Permalink sp_Print

Hi Victor

Thanks for your feedback.

Good to know the codes are useful to you.

Cheers

Sunny

Avatar
Victor Boaglio
Member
Members
Level 0
Forum Posts: 9
Member Since:
August 13, 2018
sp_UserOfflineSmall Offline
11
August 16, 2018 - 10:39 pm
sp_Permalink sp_Print

Dear Sunny. Unfortunately the code has stopped working.
I have run it on another computer and it works correctly.
I have tried reinstalling Excel, but the problem persists. (I work with excel in Spanish)
I have removed the ErrorTrap and the error it indicates is:
- the error '-2147418113 (8000ffff)' occurred at runtime:
Error in the 'newPlaylist' method of object 'IWMPPlaylistCollection'

Any ideas?

Thank you again

Victor

Avatar
SunnyKow
Puchong, Malaysia

VIP
Members


Trusted Members
Level 8
Forum Posts: 1432
Member Since:
June 25, 2016
sp_UserOfflineSmall Offline
12
August 17, 2018 - 1:02 am
sp_Permalink sp_Print

Hi Victor

I have tested the codes on my personal PC and at the workplace with no problem whatsoever.

Possibly Excel version problem (I am using Excel 2010) but I am not sure if it will run on a higher version of Excel.

I had encountered problems before with 32 and 64 bit version of Excel. Possible this could be the problem.

I may be wrong but I am not sure. Sorry I am unable to help on this issue.

Sunny

Avatar
SunnyKow
Puchong, Malaysia

VIP
Members


Trusted Members
Level 8
Forum Posts: 1432
Member Since:
June 25, 2016
sp_UserOfflineSmall Offline
13
August 17, 2018 - 10:46 am
sp_Permalink sp_Print

Hi Victor

I have tested it on Excel 2013 (64-bit) and did not encounter any problem.

I really have no idea what is causing your error.

Sunny

Avatar
Victor Boaglio
Member
Members
Level 0
Forum Posts: 9
Member Since:
August 13, 2018
sp_UserOfflineSmall Offline
14
August 17, 2018 - 12:03 pm
sp_Permalink sp_Print

Hello Sunny! I have tried reinstalling Excel, installing the 2003, 2016, 2010 versions, and the problem persists. But I think I've finally found the problem.
Each time a video is played, a playlist is created, and saved in the music \ playlist folder as follows ...
MyPlayList
MyPlayList (2)
MyPlayList (3)
MyPlayList (4)
MyPlayList (5)
...
When the copy is called "MyPlayList (1999)" the error begins
I has trying change the playlistname (MyPlayList) with any other, and the code back to life!It makes me suspect that it is then a limit of wmp
The solution that I found, so that the name is not repeated, is to replace this line
Set sPlayList = WindowsMediaPlayer1.playlistCollection.newPlaylist ("MyPlayLists")

with this

Set sPlayList = WindowsMediaPlayer1.playlistCollection.newPlaylist ("MyPlayLists" & Now)

then the playlist files now has been saved as 

MyPlayLists16-08-2018 22-42-35
MyPlayLists16-08-2018 22-42-42
MyPlayLists16-08-2018 22-42-50
MyPlayLists16-08-2018 22-42-57
MyPlayLists16-08-2018 22-43-02
...
 impossible to be repeated!

I am very happy, I am testing it and at the moment it works correctly
What I do not like is that so many files are saved. I could solve it by finding a way to create a code that erases all files " MyPlayList.* " every time the Excel file is executed.

Avatar
SunnyKow
Puchong, Malaysia

VIP
Members


Trusted Members
Level 8
Forum Posts: 1432
Member Since:
June 25, 2016
sp_UserOfflineSmall Offline
15
August 17, 2018 - 12:28 pm
sp_Permalink sp_Print sp_EditHistory

Hmm didn't know about the limit.

I would have deleted the old playlist (if one exist) before I play a new video.

Avatar
Victor Boaglio
Member
Members
Level 0
Forum Posts: 9
Member Since:
August 13, 2018
sp_UserOfflineSmall Offline
16
August 17, 2018 - 12:48 pm
sp_Permalink sp_Print sp_EditHistory

It would also be a valid option! but I think it can generate a little delay between the playslist play

Avatar
SunnyKow
Puchong, Malaysia

VIP
Members


Trusted Members
Level 8
Forum Posts: 1432
Member Since:
June 25, 2016
sp_UserOfflineSmall Offline
17
August 17, 2018 - 2:38 pm
sp_Permalink sp_Print

You can try this code to delete the files.

Sub DeletePlayList()
On Error Resume Next
Kill "C:\Users\UserName\Music\Playlists\MyPlayList*.wpl"
On Error GoTo 0
End Sub

Avatar
Victor Boaglio
Member
Members
Level 0
Forum Posts: 9
Member Since:
August 13, 2018
sp_UserOfflineSmall Offline
18
August 19, 2018 - 6:38 am
sp_Permalink sp_Print

That code works correctly, but, only in my computer. When a teacher will try to run in your system, it will dont run because the folder is different.
Im thinking in a code to obtain the windows user name to replace the UserName automatically in each case.

Avatar
SunnyKow
Puchong, Malaysia

VIP
Members


Trusted Members
Level 8
Forum Posts: 1432
Member Since:
June 25, 2016
sp_UserOfflineSmall Offline
19
August 20, 2018 - 12:56 am
sp_Permalink sp_Print sp_EditHistory

You can try this to get the user name

Sub DeletePlayList()

MyName=environ("username")

On Error Resume Next
Kill "C:\Users\" & MyName & "\Music\Playlists\MyPlayList*.wpl"
On Error GoTo 0
End Sub

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Brian Pham, Chandler Davis, Valentyn Kristioglo
Guest(s) 8
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 870
Purfleet: 412
Frans Visser: 346
David_Ng: 306
lea cohen: 219
A.Maurizio: 202
Jessica Stewart: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
drsven
Annie Witbrod
wahab tunde
Cong Le Duc
Faisal Bashir
Ivica Cvetkovski
Blaine Cox
Shankar Srinivasan
riyepa fdgf
Hannah Cave
Forum Stats:
Groups: 3
Forums: 24
Topics: 6205
Posts: 27212

 

Member Stats:
Guest Posters: 49
Members: 31880
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.