Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default 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
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
how do I import data in excel form SQL server? Mitch Excel Worksheet Functions 7 April 15th 10 03:49 PM
ARRAY - Counting Games Played bob Excel Worksheet Functions 2 November 1st 08 05:40 AM
Import Filled out Order Form (.txt) into an excel database. robbradal Excel Discussion (Misc queries) 3 May 7th 08 08:29 PM
Import text from Word Form to Excel CBER Excel Discussion (Misc queries) 1 September 13th 07 04:52 PM
I played with my windows theme, now I can't see Excel cell format grndplane Excel Discussion (Misc queries) 5 February 9th 07 07:24 PM


All times are GMT +1. The time now is 09:21 AM.

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

About Us

"It's about Microsoft Excel"