+ Reply to Thread
Results 1 to 3 of 3

Sound File Playing Twice

  1. #1
    Registered User
    Join Date
    09-07-2011
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    27

    Sound File Playing Twice

    I have a clock that updates every second :

    Please Login or Register  to view this content.
    And I have a sound player

    Please Login or Register  to view this content.

    I also have a function that will call this sub when a cell equals to the time

    IF(A1 = Clock time), call Sub

    inside A1 I have 10:30:00 AM.

    My Problem is that it will play this wav file two times. It seems like when it the clock hits 10:30:00 and TRUE, it will play one time, then when it hits 10:30:01 and FALSE, it will play it again

    If I manually change the cell to TRUE, it will play it one time. And changing it back to FALSE, wont play it a second time.

    Does this have to do with the timing of Excel? Calling it once right at 10:30:00, and then causing a .calculate when it flags to TRUE and calling it again? (Not even sure if this makes sense)

    Ive tried rewriting the code from scratch and that I couldn't figure out what the problem was.

    Thanks for any help

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,613

    Re: Sound File Playing Twice

    Standard OnTime is designed with longer periods in mind (1 second is the shortest possible time).
    I think this thread could be helpfull for you: https://www.excelforum.com/excel-pro...f-seconds.html (even if you do not plan to use half second frequency
    Best Regards,

    Kaper

  3. #3
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,009

    Re: Sound File Playing Twice

    .
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Playing sound on target hit only once
    By AndrewLD in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 05-16-2014, 12:34 PM
  2. Looping through cells and playing sound if?
    By Help-for-Heroes in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-25-2013, 09:14 AM
  3. Playing Sound file without pausing code
    By beat in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-17-2013, 05:48 AM
  4. Playing a sound with a VLOOKUP
    By Mongol76 in forum Excel General
    Replies: 10
    Last Post: 08-03-2012, 03:46 PM
  5. Playing a sound file from Excel
    By Larry in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-10-2006, 02:50 PM
  6. playing a sound in a macro
    By Kelly 1st in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-28-2005, 08:35 AM
  7. Playing sound in VBA
    By Pete in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-10-2005, 09:05 AM

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