Hi all,
I have created a spreadsheet that monitors qualification expiration dates for members of staff, and changes colour using conditional formatting, Green if Qual is current, orange when 30days to expiration and red when 7 days to expiration.
I want to set the spreadsheet to open up daily using windows, which i know how to do. However, when it opens i would like it to check the cell table for any dates which expire in 30days or less (orange) and if there are any, to alert me via email, then save and close itself.
Please help!!
Anxiously awaiting your responses
Many Thanks
James
PS. I have attempted this unsuccessfully myself via the method below:
Private Sub Workbook_Open()
If Range("C10:L27").Value = "<B34" Then
Application.Run "Mail_workbook_Outlook_1"
Else
End If
End Sub
which should use:
Sub Mail_workbook_Outlook_1()
'Working in Excel 2000-2013
'This example send the last saved version of the Activeworkbook
'For Tips see: http://www.rondebruin.nl/win/winmail/Outlook/tips.htm
Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.to = "@.co.uk"
.CC = "@.co.uk"
.BCC = ""
.Subject = "Expiring Soon"
.Body = "Please Check the attached Training record for expiring qualifications"
.Attachments.Add ActiveWorkbook.FullName
'You can add other files also like this
'.Attachments.Add ("C:\test.txt")
.Send 'or use .Display
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
I have created a spreadsheet that monitors qualification expiration dates for members of staff, and changes colour using conditional formatting, Green if Qual is current, orange when 30days to expiration and red when 7 days to expiration.
I want to set the spreadsheet to open up daily using windows, which i know how to do. However, when it opens i would like it to check the cell table for any dates which expire in 30days or less (orange) and if there are any, to alert me via email, then save and close itself.
Please help!!
Anxiously awaiting your responses
Many Thanks
James
PS. I have attempted this unsuccessfully myself via the method below:
Private Sub Workbook_Open()
If Range("C10:L27").Value = "<B34" Then
Application.Run "Mail_workbook_Outlook_1"
Else
End If
End Sub
which should use:
Sub Mail_workbook_Outlook_1()
'Working in Excel 2000-2013
'This example send the last saved version of the Activeworkbook
'For Tips see: http://www.rondebruin.nl/win/winmail/Outlook/tips.htm
Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.to = "@.co.uk"
.CC = "@.co.uk"
.BCC = ""
.Subject = "Expiring Soon"
.Body = "Please Check the attached Training record for expiring qualifications"
.Attachments.Add ActiveWorkbook.FullName
'You can add other files also like this
'.Attachments.Add ("C:\test.txt")
.Send 'or use .Display
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
Last edited: