Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Email alert from Excel

I am at the starting point of designing a holiday planning sheet for staff
for 2007. Is it possible once the staff member has inputted the dates that
they want for Rostered Days Off or Annual Leave or the like to have an email
sent to them a couple of days prior reminiding them that they have leave
pending (just in case they want to change it)? Also, as the administrator of
the sheet I would like to be alerted anytime an employee puts a new date into
the sheet
--
Hope you can help
Kind Regards
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 172
Default Email alert from Excel

sheet1 - Right click on tab(bottom) select:
View Code - Left Drop List select WORKSHEET - Right Tab Select - DEACTIVATE.
Meaning it will send an email to specified recipients whe the work sheet is
closed off.

Should bring up in below box:

Private Sub Worksheet_Deactivate() ' <= Line 1
'<== Insert email code here to suit
End Sub ' <==== Line 2

Have a look at this link for email options and place code with email
addresses between the line 1 and 2 above.
http://www.rondebruin.nl/sendmail.htm

Something like:
Private Sub Worksheet_Deactivate()
Application.DisplayAlerts = False
'Working in 97-2007
Dim wb As Workbook
Dim Shname As Variant
Dim Addr As Variant
Dim N As Integer
Dim TempFilePath As String
Dim TempFileName As String
Dim FileExtStr As String
Dim FileFormatNum As Long

Shname = Array("Sheet1", "Sheet2") ' <========= Sheets to send
Addr = , ) '<= Email addresses

If Val(Application.Version) = 12 Then
'You run Excel 2007
FileExtStr = ".xlsm": FileFormatNum = 52
Else
'You run Excel 97-2003
FileExtStr = ".xls": FileFormatNum = -4143
End If

With Application
.ScreenUpdating = False
.EnableEvents = False
End With

TempFilePath = Environ$("temp") & "\"

'Create the new workbooks/Mail it/Delete it
For N = LBound(Shname) To UBound(Shname)

TempFileName = "Sheet " & Shname(N) & " " & Format(Now, "dd-mmm-yy
h-mm-ss")

ThisWorkbook.Sheets(Shname(N)).Copy
Set wb = ActiveWorkbook

With wb
.SaveAs TempFilePath & TempFileName & FileExtStr, FileFormatNum
On Error Resume Next
.SendMail Addr(N), _
"This is the Subject line"
On Error Resume Next
.Close SaveChanges:=False
End With

Kill TempFilePath & TempFileName & FileExtStr

Next N

With Application
.ScreenUpdating = True
.EnableEvents = True
End With

Application.DisplayAlerts = True
End Sub


Corey....

"Flea" wrote in message
...
I am at the starting point of designing a holiday planning sheet for staff
for 2007. Is it possible once the staff member has inputted the dates
that
they want for Rostered Days Off or Annual Leave or the like to have an
email
sent to them a couple of days prior reminiding them that they have leave
pending (just in case they want to change it)? Also, as the administrator
of
the sheet I would like to be alerted anytime an employee puts a new date
into
the sheet
--
Hope you can help
Kind Regards



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 2003 FAILS, but Excel 2000 SUCCEEDS ??? Richard Excel Discussion (Misc queries) 2 May 13th 23 11:46 AM
working on excel document in email saved changes in email not in . butter Excel Discussion (Misc queries) 2 February 20th 06 09:25 AM
Why loss of excel formatting in email attachment on Win platform? Steve Malicki Excel Discussion (Misc queries) 1 February 16th 06 09:17 PM
Copy Name and email address from web sites to excel sheet Philip Excel Discussion (Misc queries) 0 August 10th 05 11:02 AM
How do I automatically send daily email of updated Excel workbook. How to automate emails with excel file. Excel Discussion (Misc queries) 1 May 9th 05 08:55 PM


All times are GMT +1. The time now is 08:32 AM.

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"