Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default VBA: PLAY and WAIT

Hello, I would like to create a macro that will:

1) play a WAV file
2) wait 5 seconds
3) play the WAV file again
4) wait 10 seconds
5) play the WAV file again
6) wait 5 seconds
7) play the WAV file again

Thanks!!!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default PLAY and WAIT

Which part do you need help with.

For the "wait" use
application.ontime

--
Tim Williams
Palo Alto, CA


"One-Leg" wrote in message
...
Hello, I would like to create a macro that will:

1) play a WAV file
2) wait 5 seconds
3) play the WAV file again
4) wait 10 seconds
5) play the WAV file again
6) wait 5 seconds
7) play the WAV file again

Thanks!!!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default PLAY and WAIT

Basically, I would like to know the code to play a WAV file and also the code
to have a delay between 2 commands

"Tim Williams" wrote:

Which part do you need help with.

For the "wait" use
application.ontime

--
Tim Williams
Palo Alto, CA


"One-Leg" wrote in message
...
Hello, I would like to create a macro that will:

1) play a WAV file
2) wait 5 seconds
3) play the WAV file again
4) wait 10 seconds
5) play the WAV file again
6) wait 5 seconds
7) play the WAV file again

Thanks!!!




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default VBA: PLAY and WAIT

I FINALLY FOUND IT!!! I need to run this "sound()" macro and it works...

Declare Function sndPlaySound32 Lib "winmm.dll" Alias "sndPlaySoundA" _
(ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Sub PlaySound()
Call sndPlaySound32("C:\Sound.wav", 0)
End Sub
Sub sound()
Call sndPlaySound32("C:\Sound.wav", 0)
Application.OnTime Now + TimeValue("00:00:05"), "PlaySound"
End Sub
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
sendkeys(keys,wait) how do I use wait MM Excel Discussion (Misc queries) 1 February 11th 09 03:47 PM
Learn Everything !!! Play something!!! [email protected] Charts and Charting in Excel 0 February 8th 08 09:39 AM
Go to and play instereo911 via OfficeKB.com Excel Discussion (Misc queries) 2 October 18th 06 08:25 PM
How play a wav file Scott Excel Programming 2 April 21st 04 08:32 PM


All times are GMT +1. The time now is 11:42 PM.

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

About Us

"It's about Microsoft Excel"