Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
can you import an mp3 to VB in Excel '03 to be played when a form.
I want to save an mp3 file in my code to be played when a certain user form
opens. The help file says that sounds have been removed from excel. Can I do this? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
can you import an mp3 to VB in Excel '03 to be played when a form.
Not using anything native to Excel, at least not that I am aware of. You
would need to have a reference to an mp3 player (e.g. Windows Media Player) in your project (and make sure you can distribute it to all users) and then use the mp3 player's object model to load and play your file. "alan5022" wrote: I want to save an mp3 file in my code to be played when a certain user form opens. The help file says that sounds have been removed from excel. Can I do this? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
can you import an mp3 to VB in Excel '03 to be played when a form.
If you provide the .mp3 file and make sure it's located in the same location as
your workbook, maybe you could just let windows start up the user's MP3 player. In the Userform module: Option Explicit Private Sub UserForm_Initialize() Dim myFileName As String myFileName = ThisWorkbook.Path & "\mymusic.mp3" ShellExecute 0, "", myFileName, "", "", 0 End Sub In a general module: Option Explicit Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _ (ByVal hwnd As Long, ByVal lpOperation As String, _ ByVal lpFile As String, ByVal lpParameters As String, _ ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long alan5022 wrote: I want to save an mp3 file in my code to be played when a certain user form opens. The help file says that sounds have been removed from excel. Can I do this? -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how do I import data in excel form SQL server? | Excel Worksheet Functions | |||
ARRAY - Counting Games Played | Excel Worksheet Functions | |||
Import Filled out Order Form (.txt) into an excel database. | Excel Discussion (Misc queries) | |||
Import text from Word Form to Excel | Excel Discussion (Misc queries) | |||
I played with my windows theme, now I can't see Excel cell format | Excel Discussion (Misc queries) |