PC Review


Reply
Thread Tools Rate Thread

Auto Open file to run Mail macro

 
 
=?Utf-8?B?bm9zcGFtaW5saWNo?=
Guest
Posts: n/a
 
      23rd Oct 2006
I've created a spreadsheet and macro - using the excellent info provided by
Ron de Bruin on his website - to automatically send an email message to
various recipients on dates which are calculated on the spreadsheet.

The next step is to set this up so the file opens every day, the macro runs
and generates emails if appropriate then closes the file.

I thought of doing something like putting the file in the Start menu, naming
the macro Auto_Open and adding some code at the end of the macro to close the
file.

However, I'm concerned that on days a message is due to be sent this could
happen as many times as the computer is booted up plus if the user (not me)
needs to change the dates on the sheet opening the file would run the macro
(and possibly re-send mails) again.

I would be grateful for any suggestions as to how to achieve what I want and
how best to code it.

Many thanks in anticipation


 
Reply With Quote
 
 
 
 
=?Utf-8?B?Q2hhZEY=?=
Guest
Posts: n/a
 
      23rd Oct 2006
A thought -

You could have a hidden sheet living in your document who's only job is
to record instances each day of when you sent your email. Something like
on a Workbook_Open event, have a macro go check the value of a cell for that
day (that keeps getting updated on a Workbook_Close event) ... If the cell
contains
a value, dont send the email (to prevent from spamming over and over for
that day.

Then on a Workbook_Close, if you've already sent for that day, store some
sort
of value there to prevent Workbook_Open from sending out (and check the time
of day), if time of day is, say >5:00pm for example, clear the flag out.

Just an idea,
Chad


"nospaminlich" wrote:

> I've created a spreadsheet and macro - using the excellent info provided by
> Ron de Bruin on his website - to automatically send an email message to
> various recipients on dates which are calculated on the spreadsheet.
>
> The next step is to set this up so the file opens every day, the macro runs
> and generates emails if appropriate then closes the file.
>
> I thought of doing something like putting the file in the Start menu, naming
> the macro Auto_Open and adding some code at the end of the macro to close the
> file.
>
> However, I'm concerned that on days a message is due to be sent this could
> happen as many times as the computer is booted up plus if the user (not me)
> needs to change the dates on the sheet opening the file would run the macro
> (and possibly re-send mails) again.
>
> I would be grateful for any suggestions as to how to achieve what I want and
> how best to code it.
>
> Many thanks in anticipation
>
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I auto run my macro upon open of file....Workbook_Open() is NOT working? meghantrus@hotmail.com Microsoft Excel Programming 6 19th Sep 2007 02:19 PM
How to auto activate macro when file open ? =?Utf-8?B?Ym9uemlv?= Microsoft Excel Worksheet Functions 1 16th Dec 2005 02:45 PM
open up an excel program with an auto open macro john.9.williams@bt.com Microsoft Excel Programming 2 17th Jul 2005 04:48 PM
Auto run macro on *.csv file open =?Utf-8?B?Q1AgUG9l?= Microsoft Excel Programming 4 4th Mar 2005 06:25 PM
Auto run macro on open file =?Utf-8?B?RGlhbmUgQWxzaW5n?= Microsoft Excel Programming 2 16th Feb 2005 02:05 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:56 PM.