Results 1 to 15 of 15
  1. #1
    2 Star Lounger
    Join Date
    Jul 2001
    Location
    Kuala Lumpur , MALAYSIA
    Posts
    154
    Thanks
    0
    Thanked 0 Times in 0 Posts

    music accompany file (EXCEL 2000)

    Hello guys,

    I need you help again. i have been assign to make presentation
    using computer for my company . they dont care which program
    i use to present it as long as the 5 minutes presentation is
    accompany by music. so this is what i try to do.. i need
    this music includes when i launch my file (auto_open).
    my presentation will be 5 minutes. so how do this music continously play for 5 minutes and it started as soon as i opened my file. FYI , the music is in MP3. thanks and hope this is possible .

    ps : please dont tell me to use power point coz i believe
    excel can do any task. thanks and regards and one more
    thing. is is possible to include the music in the excel file
    (my presentation file that is : present.xls )

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: music accompany file (EXCEL 2000)

    I won't tell you to use PowerPoint, but that is what I would use. PowerPoint knows how to do sound and graphics. You are going to have to spend a lot of unnecessary time trying to coerse Excel into doing it.
    Legare Coleman

  3. #3
    2 Star Lounger
    Join Date
    Jul 2001
    Location
    Kuala Lumpur , MALAYSIA
    Posts
    154
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: music accompany file (EXCEL 2000)

    hello legare,

    so you are saying its most impossible to do this with excel ?
    sorry to ask again , but is it too hard, coz i really thing thing to be done with excel. thanks

  4. #4
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: music accompany file (EXCEL 2000)

    No, that is not what I am saying. I am saying that if it can be done, it iw probably going to be fairly difficult and will take VBA code. I don't know how to do it, but it probably could be done.
    Legare Coleman

  5. #5
    2 Star Lounger
    Join Date
    Jul 2001
    Location
    Kuala Lumpur , MALAYSIA
    Posts
    154
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: music accompany file (EXCEL 2000)

    thanks legare for the explanation. anybody who can do this, please help me. thanks again and regards.

  6. #6
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Dallas plus 20 miles or so, Texas, USA
    Posts
    876
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: music accompany file (EXCEL 2000)

    I gotta say that I am with Legare in that Power Point was designed for that sort of thing, and you could spend a huge number of hours getting Excel to do what you are trying to force it to do. I mean, if Excel was meant for this sort of thing, then they wouldn't have developed Power Point.

  7. #7
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Queanbeyan, New South Wales, Australia
    Posts
    3,730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: music accompany file (EXCEL 2000)

    Many years ago, I was told it was possible to do anything in any programming language. Just like it's possible to do needlepoint while wearing boxing gloves.

    NiuB, your learning curve, I suspect, will be a lot smaller learning some Powerpoint. And you will have the extra advantage you can put something on your resume.

    I have seen stuff about running sound files from VB, so it's probably possible. You might have to look further than here to do it though.
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

  8. #8
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Kortrijk, Belgium
    Posts
    571
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: music accompany file (EXCEL 2000)

    I agree with the other posters that this is something for Powerpoint. However, if you only want to start playing your sound, maybe you can do it from a CD-ROM. You can start the execution of a WAV file or a MIDI file with APIs from VBA. To play a WAV file you can use the 'PlaySound' function from the winnm.dll and to play a MIDI file you can use the 'mciExecute' function from that same dll.

  9. #9
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: music accompany file (EXCEL 2000)

    I don't think VBA has any direct support for MP3 files, so if you want to use an mp3 format file I think you will have to launch your mp3 player, (WinAmp, Musicmatch or MediaPlayer etc). Assuming your system has the filetype mp3 registered to a particular application such as one of the above named, the following code will launch and play an MP3 file<pre> 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

    Sub Auto_Open()
    Call ShellExecute(0&, "open", <font color=red>"PathFilename.mp3"</font color=red>, _
    vbNullString, vbNullString, vbHide)
    End Sub</pre>

    replacing the red text with the path and file name of you mp3 file.

    Probably the best approach is to have your mp3 player active but minmised before you open your workbook, especially if your system is in any way slow. If possibe and necessary you can configure you player's playmode to Repeat if your mp3 file plays for less than the required 5 minutes.

    Andrew C

  10. #10
    2 Star Lounger
    Join Date
    Jul 2001
    Location
    Kuala Lumpur , MALAYSIA
    Posts
    154
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: music accompany file (EXCEL 2000)

    hehe. thanks andrew. you always have a positive answer. i will try it and will let you know the result. thanks once more and regards

  11. #11
    Bronze Lounger
    Join Date
    Nov 2001
    Location
    Arlington, Virginia, USA
    Posts
    1,394
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: music accompany file (EXCEL 2000)

    Another option is use Insert Object > Create from File command to insert the .MP3 file on a worksheet as an object. Use something like this to playback the sound:
    <pre>Sub PlayAudio()
    Application.DisplayAlerts = False
    Worksheets(1).Shapes("Object 1").Select
    Selection.Verb
    Application.DisplayAlerts = True
    End Sub</pre>

    You can call this sub from the Workbook_Open event to have music play upon opening workbook. As recommended by Andrew C. make sure your MP3 player is active but minimized or else it will pop up on top of your workbook (I tested this with MusicMatch Jukebox player). One possible drawback if the MP3 file is linked, when you open the workbook you get the dreaded "The workbook you opened contains automatic links to another workbook..." alert. If the MP3 file is embedded you won't have this problem, but for a 5 minute MP3 you will have a very large .XLS file.
    HTH.

  12. #12
    2 Star Lounger
    Join Date
    Jul 2001
    Location
    Kuala Lumpur , MALAYSIA
    Posts
    154
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: music accompany file (EXCEL 2000)

    mark,

    thanks also for the psoitive response..hehe. at first i think its not possible , but hearing this , make me got excited. will try it and let you guys know. regards and cheers

  13. #13
    Star Lounger
    Join Date
    Jan 2001
    Location
    WNC USA
    Posts
    89
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: music accompany file (EXCEL 2000)

    I don't know whether this will help but I found some VBA code on launching a wav file from Excel. You'd have to modify it for your mp3 file. BTW ... I found this on Peason Software's site.

    http://www.cpearson.com/excel/topic.htm


    It is very simple to have your macro code play a WAV file. First, add a Windows95 API declaration at the top of your code module:

    Declare Function sndPlaySound32 Lib "winmm.dll" Alias _
    "sndPlaySoundA" (ByVal lpszSoundName As String, _
    ByVal uFlags As Long) As Long

    Then, call the function, passing it the name of the WAV file you want to play:

    Call sndPlaySound32("c:testMySound.WAV", 0)

    BTW .... I agree with everyone else ... Powerpoint is really the way to go. I've learned a long time ago that each of the office products are designed for a very specific purpose and are expert in those features ... I've learned to use each program's functionality ... and when needed in another program ... link it.

  14. #14
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts

    Re: music accompany file (EXCEL 2000)

    Just adding my two cents - You can call on Excel while in PPT so that you get PPT and Excel working together.

    See you on the PPT board <img src=/S/hello.gif border=0 alt=hello width=25 height=29>
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

  15. #15
    2 Star Lounger
    Join Date
    Jul 2001
    Location
    Kuala Lumpur , MALAYSIA
    Posts
    154
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: music accompany file (EXCEL 2000)

    Thanks to all that provide the code, and it WORKS !!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •