MGuyM Posted August 27, 2007 Report Share Posted August 27, 2007 Hello all. I have a Macro that runs every day and performs a process on a piece of data. However, it can not perform this process until at least 24 hours since the previous process had occurred. Currently, I store this Data in an ASCII File and I process it each day approximately 10 minutes later then the day before. However, because there are other unknown variables that affect the performance, I'm finding that one some days, the process overruns the day before and begins processing the piece of data prior to the 24 hour window that it's allowed. I've been reading about the Date & Time Functions and can't seem to find if there is a Serial Number feature that could be used (similar to Excel). I'd like to store the Date/Time as a Serial Number and do a simple compare (Is NOW later then 24 hours after BEFORE, If Not, wait 5 Seconds and RE-Evaluate until True) I'm thinking I'm going to have to maniupulate it based on Date and Time as Values instead of a Serial (which is going to make this task extremely difficult when I go from one day to the next etc). Thanks!, MGuyM Quote Link to comment Share on other sites More sharing options...
Cory Posted August 27, 2007 Report Share Posted August 27, 2007 I have run into some issues in Excel where I wanted the Excel integer date and I plan on witing a subroutine sometime soon to do this. But I do have a routine that calculates the day of the year which even accounts for leap years if you're interested. It's at home on my desktop machine which is currenlty off however. Quote Link to comment Share on other sites More sharing options...
johnboy691 Posted August 27, 2007 Report Share Posted August 27, 2007 You might be able to use your registry to record the previous days operation and then have it look it up on the following day and see if it meets the crieria. Also, if you don't have access to the registry you could have a specific file to store it in one day and open and read the next. Just an idea. Quote Link to comment Share on other sites More sharing options...
MGuyM Posted August 30, 2007 Author Report Share Posted August 30, 2007 Both Ideas sound Great. Cory - Could I get that Routine? Thanks! JohnBoy691 - The problem with using the Registry is that I have 10,000 Items. That would surely flood my Registry beyond it's means. I've considered using an INI File, but not sure if I can have 10,000 Entries in it. It's gonna be a trial and error thing. Of course, that won't do me any good if I can't store the date/time as a Serial instead of spelled out. I sometimes wish that ME would allow calls to other apps like VBA or even a DLL (future enhancement request). Thanks for both your replies. Sincerely, MGuyM Quote Link to comment Share on other sites More sharing options...
Cory Posted August 30, 2007 Report Share Posted August 30, 2007 I've been meaning to extract it from the other macro and clean it up. Hold on a sec and let me sort it out for you. Quote Link to comment Share on other sites More sharing options...
Cory Posted August 30, 2007 Report Share Posted August 30, 2007 Day of Year It turns out I had already done most of the work already. Glad to get this done. Later I'll make a expanded version that will generate teh Excel integer dates from 1900 on. I often find that compairing and calculating text date are often a pain in the butt and this should make it a lot more easier. Quote Link to comment Share on other sites More sharing options...
MGuyM Posted September 12, 2007 Author Report Share Posted September 12, 2007 Thanks Cory. I'm going to see how this all works out. I appreciate your Reply and Assistance. BTW... Nice Web Site Quote Link to comment Share on other sites More sharing options...
Cory Posted September 12, 2007 Report Share Posted September 12, 2007 Dude, you're joking. That's the ugliest website I've ever had. Like my home page? Captures my mission statement. I think it says "I'm too busy to put anythign meaningful here". Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.