application.run

S

SURESH TP

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
 
M

Martin Seelhofer

Hey there
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.

Application.OnTime might be something for you. Just call
it once in an AutoOpen or AutoExec macro (or in the
Document_Open event handler) and call it again inside
your macro...

NB: You should know how long your music file plays in
order to prevent overlayed playback or periods of silence


Cheers,
Martin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Assign a sound to a variable 19
Sound repeats unending until closing workbook 2
applcation.run 4
Wavfile playing trubcated 3
Adding sount to a macro 11
WAV Files 2
Edit VBA 4
Apply Macro To Other Ranges 8

Top