Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Programming an unusual action
Is it possible to to create a macro that runs when you click on a worksheet
tab to open it, or to change the scripting to achieve that action? Specifically, we would like to have a *.wav file play when a worksheet is opened. Thanks, -- DAS |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Programming an unusual action
Here is an example
Option Explicit Declare Function sndPlaySound32 Lib "winmm.dll" Alias _ "sndPlaySoundA" (ByVal lpszSoundName As String, _ ByVal uFlags As Long) As Long Private Sub Worksheet_Activate() sndPlaySound32 "c:\windows\media\ding.wav", 0 End Sub 'This is worksheet event code, which means that it needs to be 'placed in the appropriate worksheet code module, not a standard 'code module. To do this, right-click on the sheet tab, select 'the View Code option from the menu, and paste the code in. -- HTH Bob Phillips "Dave" wrote in message ... Is it possible to to create a macro that runs when you click on a worksheet tab to open it, or to change the scripting to achieve that action? Specifically, we would like to have a *.wav file play when a worksheet is opened. Thanks, -- DAS |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Programming an unusual action
the workbook_Open event fires when a workbook is opened if the user does not
disable macros. See Chip Pearson's page on events' http://www.cpearson.com/excel/events.htm for sounds: http://support.microsoft.com/default...b;en-us;213777 XL2000: How to Play Sounds Using Visual Basic for Applications http://support.microsoft.com/default...b;en-us;158140 XL: How to Play Sounds Using Visual Basic for Applications http://support.microsoft.com/default...kb;en-us;86281 HOWTO: Play a Waveform (.WAV) Sound File in Visual Basic [Contains the Constants for the Arguments] http://support.microsoft.com/default...b;en-us;170730 WD: How to Play a .wav Sound File by Using a Macro http://support.microsoft.com/default...b;en-us;211842 WD2000: How to Play a .wav Sound File Using a Macro http://support.microsoft.com/default...b;en-us;193223 HOWTO: Use the MessageBeep API to Play System .WAV Files -- Regards, Tom Ogilvy "Dave" wrote in message ... Is it possible to to create a macro that runs when you click on a worksheet tab to open it, or to change the scripting to achieve that action? Specifically, we would like to have a *.wav file play when a worksheet is opened. Thanks, -- DAS |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Programming an unusual action
Thanks a lot! -- Dave
-- DAS "Bob Phillips" wrote: Here is an example Option Explicit Declare Function sndPlaySound32 Lib "winmm.dll" Alias _ "sndPlaySoundA" (ByVal lpszSoundName As String, _ ByVal uFlags As Long) As Long Private Sub Worksheet_Activate() sndPlaySound32 "c:\windows\media\ding.wav", 0 End Sub 'This is worksheet event code, which means that it needs to be 'placed in the appropriate worksheet code module, not a standard 'code module. To do this, right-click on the sheet tab, select 'the View Code option from the menu, and paste the code in. -- HTH Bob Phillips "Dave" wrote in message ... Is it possible to to create a macro that runs when you click on a worksheet tab to open it, or to change the scripting to achieve that action? Specifically, we would like to have a *.wav file play when a worksheet is opened. Thanks, -- DAS |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Programming an unusual action
Thank you very much!
-- DAS "Tom Ogilvy" wrote: the workbook_Open event fires when a workbook is opened if the user does not disable macros. See Chip Pearson's page on events' http://www.cpearson.com/excel/events.htm for sounds: http://support.microsoft.com/default...b;en-us;213777 XL2000: How to Play Sounds Using Visual Basic for Applications http://support.microsoft.com/default...b;en-us;158140 XL: How to Play Sounds Using Visual Basic for Applications http://support.microsoft.com/default...kb;en-us;86281 HOWTO: Play a Waveform (.WAV) Sound File in Visual Basic [Contains the Constants for the Arguments] http://support.microsoft.com/default...b;en-us;170730 WD: How to Play a .wav Sound File by Using a Macro http://support.microsoft.com/default...b;en-us;211842 WD2000: How to Play a .wav Sound File Using a Macro http://support.microsoft.com/default...b;en-us;193223 HOWTO: Use the MessageBeep API to Play System .WAV Files -- Regards, Tom Ogilvy "Dave" wrote in message ... Is it possible to to create a macro that runs when you click on a worksheet tab to open it, or to change the scripting to achieve that action? Specifically, we would like to have a *.wav file play when a worksheet is opened. Thanks, -- DAS |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excell copy action pauses for 15 second for the smallest action | Excel Discussion (Misc queries) | |||
3D chart - unusual | Charts and Charting in Excel | |||
Unusual Request... | Excel Discussion (Misc queries) | |||
Please help with unusual request? | Excel Discussion (Misc queries) | |||
Unusual question | Excel Programming |