LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 395
Default Macro triggered by date

In addition to the other answers;

If this is a workbook you are in all the time anyway, then having the timer
in the workbook is fine.

I have one workbook that is only opened when data needs to be crunched, and
that data is only available for a limited time period, so it needs to be run
right away (and not wait for the user to remember that this is the day the
data is updated). So I set the following code in a vbs file. I then created a
windows scheduled task (in XP, Start/All Programs/Accessories/System
Tools/Scheduled Tasks). When the scheduled time occurs, the user gets the
prompt and can decide whether to open/run the file.

Of course, the update prompt is limited to the one PC this is installed on,
but I only have one user who needs to update this file, so that is fine for
our project.

strUserIn = MsgBox("Run the PO file?",vbYesNo,"Automated Prompt")
If strUserIn = 6 then
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open("C:\Documents and
Settings\Max4p\Desktop\product analysis\opo5.xls")
objExcel.Visible = True
objExcel.Run "CrunchIt", "SkipEmailPrompt"
'above line runs the macro, with optional parameter
objExcel.ActiveWorkbook.Save
end if


"Risky Dave" wrote:

Hi,

I am trying to figure out how to get a macro to run every financial quarter.

The theory should be simple - have a cell somewhere that captures the last
time the macro was run (in mmm-yy format) and add 3 months. compare that
value with TODAY() and if TODAY() is greater, run the macro.

The problem I have (and I'm sure it's easy to fix I just can't figure it
out) is how to define teh last run date plus 3 months. I can't do a day count
due to the differing lengths of months and I don't know how to tell Excel to
count months.

Any help you can supply would be appreciated.

Hope this makes sense!

TIA

Dave

 
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
Macro triggered by date Lonpuz Excel Programming 4 January 18th 08 07:18 PM
Automatic copy triggered by change in date Xerxes Excel Worksheet Functions 1 November 23rd 07 11:04 AM
Macro triggered by an event Mekinnik Excel Programming 3 October 1st 07 07:46 PM
Macro triggered by a cell value change Varne Excel Programming 5 May 16th 07 12:58 PM
Macro triggered by an event AussieAVguy Excel Discussion (Misc queries) 2 June 16th 05 05:51 AM


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

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"