+ Reply to Thread
Page 2 of 2 FirstFirst 1 2
Results 16 to 21 of 21

Play sound as embed object in worksheet

  1. #16
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    2007 Enterprise
    Posts
    4,351

    Re: Play sound as embed object in worksheet

    .
    The image is not involved in playing the wav file.

    This macro is in the ThisWorkbook module :

    Please Login or Register  to view this content.
    The wav file is played automatically when the workbook is opened. You can also play the wav file by clicking on the button.
    And again, the sound will play with or without the image.

    As I indicated in my last post, nothing is being downloaded when you open the workbook. The wav file is made part of the workbook via Excel. When you send the workbook
    to someone the wav file goes along with the workbook. Again ... nothing is downloaded.

    Now, having said that ... if there were a number of wav files to be made a part of the workbook ... my personal preference would be to send those wav files along with the
    workbook (if I were sending the workbook to someone else). I would make provisions for the wav files to be placed somewhere on the other person's computer and have the
    macro written in such a way for the macro code to reference the wav file/s where they are located on the other person's computer.

  2. #17
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016
    Posts
    1,291

    Re: Play sound as embed object in worksheet

    thank you Logit,

    The wav file is made part of the workbook via Excel
    ok so how can i create wav part as part of Excel?

    And second issue,

    my personal preference would be to send those wav files along with the
    workbook (if I were sending the workbook to someone else).
    So user would have to add these files manually for specific folder yes?

    Best,
    Jacek

  3. #18
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    2007 Enterprise
    Posts
    4,351

    Re: Play sound as embed object in worksheet

    ok so how can i create wav part as part of Excel?
    Create a workbook with a path to a wav file. Like I did with the example I sent you.
    Make certain the wav file isn't a part of the Windows operating system. Find something unique
    from the internet.

    When you send the workbook (you can send the example to me) the sound should play, just as it did in my example.


    So user would have to add these files manually for specific folder yes?
    You could do it that way BUT ... as the programmer, you have the responsibility to include in your coding a means
    for the project to create the folder with the wav files in it.

  4. #19
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016
    Posts
    1,291

    Re: Play sound as embed object in worksheet

    Hi Logit,

    thank you.

    Create a workbook with a path to a wav file
    Ok, are you attaching embedded object to workbook and providing path to file?

    Best,
    Jacek

  5. #20
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    2007 Enterprise
    Posts
    4,351

    Re: Play sound as embed object in worksheet

    .
    No .. I only provided a path in the macro to the wav file on my computer.

    What sound do you hear when you open my workbook ?
    Last edited by Logit; Today at 03:54 PM.

  6. #21
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    2007 Enterprise
    Posts
    4,351

    Re: Play sound as embed object in worksheet

    .
    I believe something else is occurring here with the workbook I sent you (posted) as it probably doesn't play the sound on your side. I was presuming it did play the wav file as you were
    indicating it did. ????

    In any case, your questions prompted me to do some searching for an answer to insure a wav file could be played in a workbook without having to include the wav file itself.

    I found this resource which works very well : http://www.vbaexpress.com/forum/show...workbook-opens

    If you follow Leith's instructions (very easily done), your workbook will end up with a sheet named "Byte Data" where the wav file (which you have selected from your own computer) is converted and stored.
    His example allows for the wav file to play when the workbook is opened. I edited the code to allow for a manual play of the wav file as well.

    Please Login or Register  to view this content.

    Please Login or Register  to view this content.

    And this macro connected to a button that allows for manual play :

    Please Login or Register  to view this content.


    Both my original workbook and this one were done as an experiment ... for fun. Curiosity more than anything. I still hold to my other recommendation
    if the purpose is to have more than one wav file or if the project were something more than a "toy", I would provide for the wav files to be copied to
    the users' computer and referenced by file path in the coding.
    Attached Files Attached Files

+ Reply to Thread
Page 2 of 2 FirstFirst 1 2

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1