Check for date in Excel and run macro

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
bill123

Check for date in Excel and run macro

Post by bill123 » Wed May 19, 2004 3:43 pm

Is there a way using DDE or another method to check a date in a cell in excel and compare it to the current date? What we want to do is to stop running the macro if the date in the cell is today but continue if the date in the excel cell is earlier than today.

We also have that same date in a html file that is saved locally -- is there an easy way to check against a date that is listed in the html file?

thanks

Bill

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Thu May 20, 2004 7:37 am

Hi,

Yes, you can use DDE or VBScript/ActiveX to extract data from an Excel spreadsheet. You can then compare the date with todays date. You will probably find it easier to use VBScript for this as the format of the date will no doubt work with VBScript's date functions which are similar to those used in VBA in Excel itself.
MJT Net Support
[email protected]

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts