ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   applcation.run (https://www.excelbanter.com/excel-programming/328708-applcation-run.html)

SURESH TP

applcation.run
 
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

Bob Phillips[_6_]

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

SURESH TP

applcation.run
 
hi dear bob..
good evening.. thank you for you advise

and now what is the prob. that when i am exit the file is opening the automatically. to close the file i have to close twise.

plz. help me..

best regards,
suresh

"Bob Phillips" wrote in message ...
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

SURESH TP

applcation.run
 
hi dear bob..
good evening.. thank you for you advise

and now what is the prob. that when i am exit the file is opening the automatically. to close the file i have to close twise.

plz. help me..

best regards,
suresh

"Bob Phillips" wrote in message ...
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

Tushar Mehta

applcation.run
 
Consider using a program better suited to the task of playing background
music. Use Windows Media Player or Real Player or...

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Multi-disciplinary business expertise
+ Technology skills
= Optimal solution to your business problem
Recipient Microsoft MVP award 2000-2005

In article ,
says...
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



All times are GMT +1. The time now is 03:48 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com