Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excell DDE two dif computers

Status
Not open for further replies.

esoare

Programmer
Jun 15, 2005
199
US
So, I have a script that DDE's to excel. It works great on Computer A.
I take the same script, same excel file. To Computer B.

What happens now is that there is an extra "line feed/carriage return" being sent to the com port.

I looked around, and can't find any discrepencies on the Procomm side that would cause these issues.

Could not find anything that would make sense to me.

Any ideas?
 
Do you have the same version of Excel on both machines? I have 2003 at home and 2007 at work and use a spreadsheet at both locations. When I select a cell and copy it to the clipboard on my home machine, there are a couple spaces at the end of the string, but these are not present when using 2007 for some reason.

 
Checked.

Both Excel's are 2003 SP2. Same type.

Good idea though!

Did check the copy paste just in case.

Same results.
 
Try getting the string via DDE and then use:

usermsg "X%sX" sVar

where sVar is the string value returned from the spreadsheet. If there are no nonprintable characters in the string, you should see the value bracketed by the two Xs. If you see something blank at the end or perhaps a small black rectangle, then there may be some different data being pulled via DDE.

 
from comp a.


REQ: NEW
TYPE: 2616
TN 3 0


from comp b.

REQ: NEW
TYPE: 2616
MARP NOT ACTIVATED

TN 3 0


the "NEW/2616/3 0" are all imputed manually by me at the request from the switch.

For some reason Comp b. Does not suppress the "MARP NOT ACIVATED" + THE " Carriage return" before the TN.

There must be some kind of difference in the Procomms.

I have eliminated the Excel, because in the test I did not use excel, just entered info manually.

Going to record info, and try placing that into the script.

esoare

 
ok. There is somethin wierd happening.

Here is what I see and typed into the procomm. This Comp B.


>LD 20

PT0000
MARP NOT ACTIVATED

REQ: NEW
TYPE: 2616
MARP NOT ACTIVATED

TN 3 0
DES


Here is what was recorded by the "recorder"

waitfor ">"
transmit "LD 20^M"
waitfor "REQ: "
transmit "NEW^M"
waitfor "TYPE: "
transmit "2616^M"
waitfor "TN "
transmit "3 0^M"

let me check the other Comp. A.

ok the same thing happens on comp A. So that's not the problem.

this sure is getting frustratin.

 
OK. Figured it out.

This is the culprit!

strreplace NEW "`n " ""
strreplace TYP "`n " ""
strreplace TN "`n " ""
strreplace DES "`n " ""

Now. The same script on a Comp. A works. but on Comp B. It sends either another line feed or to blank spaces, which ruin everything.


This is how I fixed it. I removed all spaces behind the "n" and it works.
strreplace NEW "`n" ""
strreplace TYPER "`n" ""
strreplace TN "`n" ""
strreplace DES "`n" ""

I also tested on the Comp. A, for fun to make sure that did not modify anything. and that works.

Thank you knob for the help!!

I think it's happening, i'm have gone up to newbie programmer level a0. :)

Still working on the switch command. I'll post an update there later.

esoare





 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top