Jump to content
Macro Express Forums

Dates/times In Me


MGuyM
 Share

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...