#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Close Shell

Can somebody tell me how to end a Windows MediaPlayer session in Excel VBA. I
have used the Shell code to open it.

Thank you in advance for your reaction.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 131
Default Close Shell

"CanonChris" wrote:

Can somebody tell me how to end a Windows MediaPlayer session in Excel VBA. I
have used the Shell code to open it.

Thank you in advance for your reaction.



If you don't get a better answer try this. It uses Taskkill command to kill
the wmplayer.exe process.

Sub KillWMPlayer()

Shell """C:\Program Files\Windows Media Player\wmplayer.exe"" /prefetch:1",
vbNormalFocus
Application.Wait Now + TimeValue("0:00:05")
Shell "CMD /C TASKKILL /IM wmplayer.exe"

End Sub

HTH

--
urkec
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I stop the close method in an auto close macro Paul Excel Programming 2 November 17th 06 02:48 PM
In Before Close Sub ActiveWorkBook.Close(False) repeat procedure [email protected] Excel Programming 5 September 26th 06 03:11 PM
Excel shoud not close all active books when clicking close button technomike Excel Discussion (Misc queries) 0 June 10th 05 05:35 PM
Shell can open an application, can it close an app too? quartz[_2_] Excel Programming 4 April 26th 05 03:30 PM
excel - Windows close button (x) should only close active workboo. CoffeeAdict Setting up and Configuration of Excel 3 February 8th 05 04:30 AM


All times are GMT +1. The time now is 12:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"