O
Old Man River
I have written a couple of VB subs that compose and send an email reminder
from an excel application consisting of three sheets.
Sheet one is a table which contains the a column of dates next to the name
of a person who needs to carry out a duty during the week following that day.
Sheet two contains a table with the peoples names and there email addresses
(only those with emails {there are still a few who do not use computers!} are
on the list).
Sheet three calculate from todays date which person is due to do the job
from Saturday week and gets their email address or uses mine if they do not
have one.
I have written the following macro which runs automatically on opening the
spreadsheet and I hope will work with a scheduled task which runs the
application
Option Explicit 'Out of habit!
Sub Autpen()
'Stop 'useful for debugging.
Application.CalculateFull
Module1.Email_Turn 'composes and send the email
Application.DisplayAlerts 'prevent Save yes/no prompt
Application.Quit
End Sub
But is this the best approach? it certainly makes using the spreadsheet a
pain as you have to remember to press Ctrl Shift when opening it to stop it
running.
Can I perhaps use some vb (I have express 2008) to invoke the application
and call a (non Autpen) macro instead? Can I detect whether the app has
been started by the schedular or any other suggestions. I'm getting beyond my
knowledge of how all this knits together!
from an excel application consisting of three sheets.
Sheet one is a table which contains the a column of dates next to the name
of a person who needs to carry out a duty during the week following that day.
Sheet two contains a table with the peoples names and there email addresses
(only those with emails {there are still a few who do not use computers!} are
on the list).
Sheet three calculate from todays date which person is due to do the job
from Saturday week and gets their email address or uses mine if they do not
have one.
I have written the following macro which runs automatically on opening the
spreadsheet and I hope will work with a scheduled task which runs the
application
Option Explicit 'Out of habit!
Sub Autpen()
'Stop 'useful for debugging.
Application.CalculateFull
Module1.Email_Turn 'composes and send the email
Application.DisplayAlerts 'prevent Save yes/no prompt
Application.Quit
End Sub
But is this the best approach? it certainly makes using the spreadsheet a
pain as you have to remember to press Ctrl Shift when opening it to stop it
running.
Can I perhaps use some vb (I have express 2008) to invoke the application
and call a (non Autpen) macro instead? Can I detect whether the app has
been started by the schedular or any other suggestions. I'm getting beyond my
knowledge of how all this knits together!