#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default email macro

Hello all

If you remember my past messages, I have an email macro that sends a reminder email out to people if an adjacent column contains the value 5 (as in 5 days remaining until an item is due). Before i started this project, i wanted it to be fully automated. But in review of pros and cons.. making the macro autorun when the workbook is open is not feasable.. Because tons of people open this file daily and it would result in the workbook sending the same email over and over to people. Is there a way to make the workbook only run the macro once a day

Maybe somehow by putting the workbook to auto launch in the background at a certain time using windows scheduler... but i dont know how to make the macro start up during that time only... hm

any ideas? perhaps this is the wrong discussion group to be posting it on.. apologies if it is. But this is the only one i use and its somewhat related to programming since my whole project was based on that macro. heh

Thanks,
Lobo
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default email macro

hm

So what you are saying is.. somewhere in the workbook... have a cell that contains the macro name and the date it was last run.. and then have an auto code... to check

If the date it was last run = today then dont run it again. (do not launch the EmailRoutine sub
If the date it was last run is not equal to today then run it again. (launch the EmailRoutine sub

Hm this would also require me to somehow have the cell containing the last run date change when i run the EmailRoutine sub...ahhh

Sounds simple (somewhat).. but i have no idea where to start... or what to do.

does anyone have any ideas

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default email macro

alas, there is a proble

There are many computers on my network that open this file and i dont want them to send an email out to other people. I want it so that it only works from one computer....hmm maybe this goes beyond excel and is impossible.. thus i mentioned windows scheduler in my first post.

Regards
a confused but happy Lob


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 599
Default email macro

Lobo

Here's an idea: Assume your workbook is Emailbook.xls and that your macro
(Sub EmailRoutine()) is in it and is in a standard module. Make a brand new
workbook and call it ScheduleEmail.xls. In ScheduleEmail, create a
Workbook_Open event that opens Emailbook.xls and runs the macro. When the
user opens Emailbook, the macro won't run, but when ScheduleEmail is opened
it will.

To use the Workbook open event, hit Alt-F11 to open the VBE, under your
project in the Project Explorer double click ThisWorkbooks, from the
dropdown boxes select Workbook and Open.

Your Workbook_Open sub may then look like this:

Private Sub Workbook_Open()

Dim wb As Workbook

Set wb = Workbooks.Open("C:\Dick\Emailbook.xls")

Application.Run "Emailbook.xls!EmailRoutine"

wb.Close True

End Sub

Finally, use Windows Scheduler to open ScheduleEmail.xls once per day. You
will probably want to digitally sign your macros so that you don't get a
warning box and so that you don't have to resort to changing your security
settings. See help for how to create a digital signature.

--
Dick Kusleika
MVP - Excel
www.dicks-clicks.com
Post all replies to the newsgroup.


"Lobo" wrote in message
...
alas, there is a problem

There are many computers on my network that open this file and i dont want

them to send an email out to other people. I want it so that it only works
from one computer....hmm maybe this goes beyond excel and is impossible..
thus i mentioned windows scheduler in my first post..

Regards,
a confused but happy Lobo




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
Email Macro Gazz_85[_2_] Excel Discussion (Misc queries) 1 May 14th 10 02:01 PM
Using Macro how to create email link for the email addresses in aRange or Selection Satish[_2_] Excel Worksheet Functions 8 December 28th 09 03:30 PM
Email Macro help! Ken[_2_] Excel Worksheet Functions 2 January 6th 09 02:42 PM
How do I create an email macro to auto fill the email? Justin[_4_] Excel Discussion (Misc queries) 0 November 14th 07 10:49 PM
macro to email Scott Marcus Excel Discussion (Misc queries) 1 June 21st 06 03:04 PM


All times are GMT +1. The time now is 06:15 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"