"LF" and "CR"

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
bobox
Newbie
Posts: 2
Joined: Tue Apr 19, 2022 8:23 am

"LF" and "CR"

Post by bobox » Tue Apr 19, 2022 8:42 am

Hello,

I have Excel cells which happen to have text "LF" and "CR" (Sub-accounts).

When I send (Send>%SubAccount%) the Excel field text to the target application, it appears to be sending line feed (LF) or carriage return (CR) rather than the text "LF" or "CR", resulting in the field in the target application defaulting to a default value of "01" rather than the "LF" or "CR" Sub-account code. The other few thousand sub-accounts are fine, just ones which happen to have these "reserved" characters.

How do I send the literal value?

My half-arsed option was to send sub-account characters individually, eg Send> L Send> F, to avoid the problem.

Thanks
Bob

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1348
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: "LF" and "CR"

Post by Dorian (MJT support) » Tue Apr 19, 2022 9:12 am

There are two answers to this. The one that answers the question, and the correct one. :)

To answer the question :

Code: Select all

send>{"CR"}
send>{"LF"}
But the preferred method is to not send text to Excel cells at all, but to use the Macro Scheduler Excel Commands XLSetCell. You'll see a usage example at that link. Once you master the Excel commands you'll never look back.
Yes, we have a Custom Scripting Service. Message me or go here

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