The information in this article applies to:
SUMMARYIn Microsoft Excel versions earlier than 5.0, the ALERT() macro function automatically causes the computer to beep. In Microsoft Excel versions 5.0 and 7.0, the computer does not automatically beep when you use the ALERT() macro function or the Visual Basic MsgBox function. MORE INFORMATION
Microsoft Excel version 5.0 does not automatically beep when an ALERT() box
or MsgBox is displayed. This allows you to determine what sound (if any)
you want to be played when a message box is displayed.
Visual Basic ExampleMicrosoft provides examples of Visual Basic for Applications procedures for illustration only, without warranty either expressed or implied, including, but not limited to the implied warranties of merchantability and/or fitness for a particular purpose. The Visual Basic procedures in this article are provided 'as is' and Microsoft does not guarantee that they can be used in all situations. While Microsoft support professionals can help explain the functionality of a particular macro, they will not modify these examples to provide added functionality, nor will they help you construct macros to meet your specific needs. If you have limited programming experience, you may want to consult one of the Microsoft Solution Providers. Solution Providers offer a wide range of fee-based services, including creating custom macros. For more information about Microsoft Solution Providers, call Microsoft Customer Information Service at (800) 426-9400.In Microsoft Excel version 5.0 or 7.0, open a new Visual Basic module and type the following code:
Microsoft Excel 4.0 Macro ExampleIn Microsoft Excel version 5.0 or 7.0, open a new Microsoft Excel 4.0 macro sheet and type the following macro:
Explanation of Macro CodeA1: Causes the computer to beep.A2: Displays an information alert box with the text: "Hello" A3: Ends the macro. Instead of using the =BEEP() function or the Beep procedure, you can use the SOUND.PLAY() function to play any sound before displaying the message box. For example, for a Visual Basic macro, use the following code:
For a Microsoft Excel version 4.0 macro, use the following code:
Additional query words: dialog
Keywords : xlwin |
Last Reviewed: May 17, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |