Post
by JRL » Tue May 09, 2006 5:08 am
dseibold,
I had some time tonight to play around with this. I'm suspecting that if this was working for you, you were using the originally posted vbscript. No matter what I tried I could not make the "trimming vbscript" work. Since the original poster was taking data from excel, that's what I tried also.
What I tried tonight that worked was:
- open Excel
- type a date into the A1 cell
- use ddrequest to place that date into a variable
- use Marcus' suggestion to remove the CR LF from the date
- run the original vbscript.
This is the script that worked for me. Open Excel "book1.xls", type a date into the A1 cell, then step through the following script with the watchlist open to see what happens. Then type text other than a date into cell A1 of book1.xls and step through the script with the watchlist open and see what happens. Remember that to use DDERequest the file being read must be open.
DDERequest>Excel,Book1.xls,R1C1,date,5
StringReplace>date,CR,,date
StringReplace>date,LF,,date
VBSTART
VBEND
VBEval>IsDate("%date%"),isit
If>isit=True
//whatever
EndIf
Hope this makes sense,
Dick