Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Making a "ding" sound in the macro process

Here is a macro written by someone before me:
Sub ding1()
'
' Ding Macro
MultiBeep 5
Message
End Sub

Sub MultiBeep(numbeeps)
For counter = 1 To numbeeps
Beep
Next counter
End Sub

Sub Message()
MsgBox "Sorry, I have not been assigned yet!"
End Sub

The macro goes through the process but the dings are not audible. I was
instructed to make this work, but I can't find any information on Beeps or
Dings.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Making a "ding" sound in the macro process

Try some code like the following:

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

Sub PlayChimes()
Dim N As Long
For N = 1 To 5
sndPlaySound32 "chimes", 0
Next N
End Sub


Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


On Thu, 6 Nov 2008 07:20:01 -0800, iashorty
wrote:

Here is a macro written by someone before me:
Sub ding1()
'
' Ding Macro
MultiBeep 5
Message
End Sub

Sub MultiBeep(numbeeps)
For counter = 1 To numbeeps
Beep
Next counter
End Sub

Sub Message()
MsgBox "Sorry, I have not been assigned yet!"
End Sub

The macro goes through the process but the dings are not audible. I was
instructed to make this work, but I can't find any information on Beeps or
Dings.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Making a "ding" sound in the macro process

Hi,

On the assumption you have speakers and they are switched on your code will
produce 5 beeps. However they will be so quick you will only hear one of
them. Introduce a pause with this line


Sub MultiBeep(numbeeps)
For counter = 1 To numbeeps
Beep
Application.Wait (Now + TimeValue("0:00:01"))
Next counter
End Sub

Mike

"iashorty" wrote:

Here is a macro written by someone before me:
Sub ding1()
'
' Ding Macro
MultiBeep 5
Message
End Sub

Sub MultiBeep(numbeeps)
For counter = 1 To numbeeps
Beep
Next counter
End Sub

Sub Message()
MsgBox "Sorry, I have not been assigned yet!"
End Sub

The macro goes through the process but the dings are not audible. I was
instructed to make this work, but I can't find any information on Beeps or
Dings.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Making a "ding" sound in the macro process

I don't understand your declaration Function paragraph. Is this exactly what
I should type?


"Chip Pearson" wrote:

Try some code like the following:

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

Sub PlayChimes()
Dim N As Long
For N = 1 To 5
sndPlaySound32 "chimes", 0
Next N
End Sub


Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


On Thu, 6 Nov 2008 07:20:01 -0800, iashorty
wrote:

Here is a macro written by someone before me:
Sub ding1()
'
' Ding Macro
MultiBeep 5
Message
End Sub

Sub MultiBeep(numbeeps)
For counter = 1 To numbeeps
Beep
Next counter
End Sub

Sub Message()
MsgBox "Sorry, I have not been assigned yet!"
End Sub

The macro goes through the process but the dings are not audible. I was
instructed to make this work, but I can't find any information on Beeps or
Dings.


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Making a "ding" sound in the macro process

I don't even hear one beep. Putting a hesitation in the macro didn't help. I
hear the beeping of a new Lotus Sametime coming in so I know the speakers are
on.


"Mike H" wrote:

Hi,

On the assumption you have speakers and they are switched on your code will
produce 5 beeps. However they will be so quick you will only hear one of
them. Introduce a pause with this line


Sub MultiBeep(numbeeps)
For counter = 1 To numbeeps
Beep
Application.Wait (Now + TimeValue("0:00:01"))
Next counter
End Sub

Mike

"iashorty" wrote:

Here is a macro written by someone before me:
Sub ding1()
'
' Ding Macro
MultiBeep 5
Message
End Sub

Sub MultiBeep(numbeeps)
For counter = 1 To numbeeps
Beep
Next counter
End Sub

Sub Message()
MsgBox "Sorry, I have not been assigned yet!"
End Sub

The macro goes through the process but the dings are not audible. I was
instructed to make this work, but I can't find any information on Beeps or
Dings.




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Making a "ding" sound in the macro process

i need to explain that I am an accountant not a programmer. I have not had
any Visual Basic, just a logic and some experience in Excel and writing
macros. What I don't know, I've had to ask for help. Assume I know nothing
and maybe this will make sense to me.



"Chip Pearson" wrote:

Try some code like the following:

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

Sub PlayChimes()
Dim N As Long
For N = 1 To 5
sndPlaySound32 "chimes", 0
Next N
End Sub


Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


On Thu, 6 Nov 2008 07:20:01 -0800, iashorty
wrote:

Here is a macro written by someone before me:
Sub ding1()
'
' Ding Macro
MultiBeep 5
Message
End Sub

Sub MultiBeep(numbeeps)
For counter = 1 To numbeeps
Beep
Next counter
End Sub

Sub Message()
MsgBox "Sorry, I have not been assigned yet!"
End Sub

The macro goes through the process but the dings are not audible. I was
instructed to make this work, but I can't find any information on Beeps or
Dings.


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Making a "ding" sound in the macro process

The "Declare" statement is used to specify a function that resides in
a Windows DLL file, which is completely and fully disconnected in
every way from VBA and Excel. Windows is a collections of hundreds (?)
of individual DLL files (DLL = Dynamic Link Library), organized by
functionality. When you "Declare" a function, you instruct VBA to go
to that DLL file and execute the named function in that DLL. The
"Declare" statement must reside before and outside of any VBA
procedure (e.g., a Sub or Function procedure). It is worth noting
that when you use a DLL function with a Declare statement, you are
bypassing all of VBA's safety and error mechanisms. Any error in the
declaration of the DLL function or in the parameters passed to that
functions will likely cause Excel to crash. DLL functions can allow
you to do things not supported by Excel/VBA and they are very fast,
but they can be dangerous because VBA isn't involved to handle errors.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


On Thu, 6 Nov 2008 08:10:14 -0800, iashorty
wrote:

I don't understand your declaration Function paragraph. Is this exactly what
I should type?


"Chip Pearson" wrote:

Try some code like the following:

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

Sub PlayChimes()
Dim N As Long
For N = 1 To 5
sndPlaySound32 "chimes", 0
Next N
End Sub


Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


On Thu, 6 Nov 2008 07:20:01 -0800, iashorty
wrote:

Here is a macro written by someone before me:
Sub ding1()
'
' Ding Macro
MultiBeep 5
Message
End Sub

Sub MultiBeep(numbeeps)
For counter = 1 To numbeeps
Beep
Next counter
End Sub

Sub Message()
MsgBox "Sorry, I have not been assigned yet!"
End Sub

The macro goes through the process but the dings are not audible. I was
instructed to make this work, but I can't find any information on Beeps or
Dings.


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
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
How do I keep the ding sound from playing when a message appears? Quinn1984 Excel Discussion (Misc queries) 2 September 12th 07 01:04 PM
Read ".dll" files, the Macro "work flow" and the actual values of the variables when Macro is running [email protected] Excel Programming 5 May 16th 07 08:18 PM
stop calculating and "ding" GoBobbyGo Excel Discussion (Misc queries) 2 January 25th 07 08:09 PM
Making "examp le" become "examp_le" in a string Sworkhard Excel Programming 3 October 29th 04 09:31 PM


All times are GMT +1. The time now is 04:28 PM.

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

About Us

"It's about Microsoft Excel"