I've been using a script using ver 7.3 where a value from Excel is copied to the clipboard and set as a variable. The variable is then SEND> to a field in a Citrix screen and move another field to SEND> a different variable.
I updated to Ver7.4 and the SEND> command sends the variable and simulates press enter.
In Ver 7.4 how can I send a Variable text string to a field and move to another field without the press enter event occuring.
Send> also submits ENTER command in 7.4
Moderators: JRL, Dorian (MJT support)
This is nothing to do with the Send command. We have changed nothing to do with this command. However, sometimes Excel puts carriage return or line feed characters at the end of cell contents. This is probably causing the return. Try trimming the cell contents by one char.
MJT Net Support
[email protected]
[email protected]
Here is some simple code to strip the CRLF from the data read from Excel. I am not sure if you can ever read Excel data without the CRLF, but this code is written to handle it if it exists or not.
DDERequest>Excel,C:\SomeFile.xls,R1C6,VarName,30
Position>%CRLF%,VarName,1,CRLFFlag
Length>VarName,LengthOfRecord
if>%CRLFFlag%>0
LET>LengthOfRecord=%CRLFFlag%-1
MidStr>%VarName%,1,%LengthOfRecord%,VarName
Else>
MidStr>%VarName%,1,%LengthOfRecord%,VarName
Endif>
SkunkWorks
DDERequest>Excel,C:\SomeFile.xls,R1C6,VarName,30
Position>%CRLF%,VarName,1,CRLFFlag
Length>VarName,LengthOfRecord
if>%CRLFFlag%>0
LET>LengthOfRecord=%CRLFFlag%-1
MidStr>%VarName%,1,%LengthOfRecord%,VarName
Else>
MidStr>%VarName%,1,%LengthOfRecord%,VarName
Endif>
SkunkWorks
-
- Junior Coder
- Posts: 22
- Joined: Mon Sep 12, 2005 1:34 am
- Location: Melbourne - Australia
A simple script to tackle problem where Excel includes "hidden" characters at the end of text/linefeed copied from cells.
Asigns text to variable %CellText%
Consider using MsAccess Database for larger jobs. Access doesn't "suffer" from this problem and has the benifit of "Saving" info every time you grab next record.
Tested with MsExcel 2,5,97,XP and 2003
SRT>GetCellTextOnly
Press F2
Press Shift
Press Home
Release Shift
Press CTRL
Send>c
Release CTRL
Press ESC
GetClipBoard>CellText
End>GetCellTextOnly
SetFocus>Microsoft Excel*
GoSub>GetCellTextOnly
MessageModal>Actual text displayed between the arrows%CRLF%>%CellText%
Asigns text to variable %CellText%
Consider using MsAccess Database for larger jobs. Access doesn't "suffer" from this problem and has the benifit of "Saving" info every time you grab next record.
Tested with MsExcel 2,5,97,XP and 2003
SRT>GetCellTextOnly
Press F2
Press Shift
Press Home
Release Shift
Press CTRL
Send>c
Release CTRL
Press ESC
GetClipBoard>CellText
End>GetCellTextOnly
SetFocus>Microsoft Excel*
GoSub>GetCellTextOnly
MessageModal>Actual text displayed between the arrows%CRLF%>%CellText%
Macro Scheduler since Version 5.0 - 21/10/1998