Thread: applcation.run
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default applcation.run

Try this

Private nTime As Date

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

Private Sub test()
playSound
End Sub

Sub playSound()
Const SND_ASYNC = &H1
Const SND_FILENAME = &H20000
nTime = Now() + TimeSerial(0, 0, 10) ' 10 secs
sndPlaySound "C:\Windows\Media\Microsoft Office 2000\Chimes.wav", SND_ASYNC
Application.OnTime nTime, "playSound"
End Sub

Sub stopSound()
Application.OnTime nTime, "playsound", schedule:=False
End Sub



--

HTH

RP
(remove nothere from the email address if mailing direct)


"SURESH TP" wrote in message ...
good morning to everybody


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

Private Sub test()
sndPlaySound "C:\Suresh\Twinkle1.wav", SND_ASYNC
End Sub

the above metioned macro is working well.. the prob. is that i want to keep this as my backgroud music, meanwhile i want to work as usual.. and also it should run until i will close the file.

anybody can help me??

thanks in advance

with best regards,
suresh tp