Problems Conserning Result Variables... I think =S

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
Seezer
Newbie
Posts: 6
Joined: Sun Nov 08, 2009 12:47 am

Problems Conserning Result Variables... I think =S

Post by Seezer » Sun Nov 15, 2009 6:41 pm

My final goal is to have a Dialog box that pulls information from an excel spreadsheet if a date in the excel row is less than 6 months from the current date, but at the moment I am stuck at getting it to recognize that the excel date is the same as the current date generated within the script.
It works when I wright it out like this:


Let>R2_EAS=11/15/2009
Getdate>Current_Date

Messagemodal>current_Date
Messagemodal>R2_EAS
If>R2_EAS=Current_Date
Messagemodal>it worked
Else

Endif

But I want to replace the first line (Let>R2_EAS=11/15/2009) with either a DDERequest or something else to imput the date into the script, but when I do it doesn't recognize it no matter what I do:

DDERequest>Excel,(Path)\(File_Name).xlsx,R2C8,R2_EAS,10
(R2C8 has the Current Date.)

Getdate>Current_Date

Messagemodal>current_Date
Messagemodal>R2_EAS
If>R2_EAS=Current_Date
Messagemodal>it worked
Else

Endif

I have been using the Debugger, but I can't figure it out..

User avatar
JRL
Automation Wizard
Posts: 3529
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Mon Nov 16, 2009 3:15 pm

When you use DDERequest it grabs the cell plus carriage return and line feed characters. If you want to compare the DDERequest result to the date you have to either add those two characters to the date or strip the characters from the DDERequest result.

Code: Select all

DDERequest>Excel,(Path)\(File_Name).xlsx,R2C8,R2_EAS,10
(R2C8 has the Current Date.)

Getdate>Current_Date

Messagemodal>current_Date
Messagemodal>R2_EAS
//If>R2_EAS=Current_Date
If>R2_EAS=%Current_Date%%CRLF%
  Messagemodal>it worked
Else

EndIf


//OR (in my opinion preferred)
StringReplace>R2_EAS,%CRLF%,,R2_EAS
If>R2_EAS=Current_Date
  Messagemodal>it worked
Else

EndIf


Seezer
Newbie
Posts: 6
Joined: Sun Nov 08, 2009 12:47 am

Post by Seezer » Tue Nov 17, 2009 10:39 pm

Awesome thanks alot!

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