ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   audio alert when a shared workbook is saved by any user (https://www.excelbanter.com/excel-discussion-misc-queries/201922-audio-alert-when-shared-workbook-saved-any-user.html)

Bob W

audio alert when a shared workbook is saved by any user
 
I'd like our shared team spreadsheet to issue a little audio alert each time
someone saves the spreadsheet (thereby updating all users). Can this be done?

Chip Pearson

audio alert when a shared workbook is saved by any user
 
Try something like the following code in the ThisWorkbook code module. It
must go in the ThisWorkbook module, not a regular code module. Change
"Chimes" to the name of the sound you want to play.


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

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
sndPlaySound "Chimes", 0
End Sub


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



"Bob W" wrote in message
...
I'd like our shared team spreadsheet to issue a little audio alert each
time
someone saves the spreadsheet (thereby updating all users). Can this be
done?



Bob W

audio alert when a shared workbook is saved by any user
 
Is that going to trigger a macro warning every time anybody opens the shared
workbook? That won't fly...people will just bypass the macro (if excel is
like Word).

"Chip Pearson" wrote:

Try something like the following code in the ThisWorkbook code module. It
must go in the ThisWorkbook module, not a regular code module. Change
"Chimes" to the name of the sound you want to play.


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

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
sndPlaySound "Chimes", 0
End Sub


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



"Bob W" wrote in message
...
I'd like our shared team spreadsheet to issue a little audio alert each
time
someone saves the spreadsheet (thereby updating all users). Can this be
done?



Chip Pearson

audio alert when a shared workbook is saved by any user
 
If the user doesn't enable macros (or opens the workbook file while holding
the SHIFT key), the code won't run. Unfortunately, there is no other way to
do it.


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




"Bob W" wrote in message
...
Is that going to trigger a macro warning every time anybody opens the
shared
workbook? That won't fly...people will just bypass the macro (if excel is
like Word).

"Chip Pearson" wrote:

Try something like the following code in the ThisWorkbook code module. It
must go in the ThisWorkbook module, not a regular code module. Change
"Chimes" to the name of the sound you want to play.


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

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
sndPlaySound "Chimes", 0
End Sub


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



"Bob W" wrote in message
...
I'd like our shared team spreadsheet to issue a little audio alert each
time
someone saves the spreadsheet (thereby updating all users). Can this
be
done?




Bob W

audio alert when a shared workbook is saved by any user
 
Chip, thanks for the macro; i guess we will have to get our team together and
tell them to enable macros....

"Chip Pearson" wrote:

If the user doesn't enable macros (or opens the workbook file while holding
the SHIFT key), the code won't run. Unfortunately, there is no other way to
do it.


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




"Bob W" wrote in message
...
Is that going to trigger a macro warning every time anybody opens the
shared
workbook? That won't fly...people will just bypass the macro (if excel is
like Word).

"Chip Pearson" wrote:

Try something like the following code in the ThisWorkbook code module. It
must go in the ThisWorkbook module, not a regular code module. Change
"Chimes" to the name of the sound you want to play.


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

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
sndPlaySound "Chimes", 0
End Sub


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



"Bob W" wrote in message
...
I'd like our shared team spreadsheet to issue a little audio alert each
time
someone saves the spreadsheet (thereby updating all users). Can this
be
done?




All times are GMT +1. The time now is 09:36 AM.

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