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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Aspect and dde to excel

Status
Not open for further replies.

elohelae

Technical User
Feb 25, 2011
27
0
0
GB
I am using an example on the aspectscripting website in reference to the dde to an excel spreadsheet.

this is an example from it

if ddeinit SystemVar "excel" "system"
ddeexecute SystemVar "[FULL(TRUE)]" ;Maximize the spreadsheet.
if ddeinit LinkVar "excel" "sheet1" ;Set up link to spreadsheet.

while 1 ;Loop forever.
strfmt sRowCol "R%dC%d" iRow iCol ;Format request for data from current row, column 1
dderequest LinkVar sRowCol szText ;Read data from spreadsheet, current row, column 1
pause 1

switch szText
case "y"
transmit "!y success"
endcase

case "n"
transmit "!n success"
endcase

default
transmit "!default selected"
endcase

endswitch


endwhile

The excel file just has the letter y in it and if i do a transmit sztext then it transmits Y.

Currently the default action is the only action that responds.

What do i need to change, to have it properly examine the contents of the cell and then exact a reponse based on the cells contents?

I appreciate any help or guidance with this.
 
i think i just found the answer on a different thread, is this correct?

"FYI, be aware that data read from Excel will have a carrige return and line feed at the end of it that may cause you problems. You can use the commands strreplace szText "`n" "" and strreplace szText "`r" "" to strip these extra characters out. "

i will give it a try and let you know and if anyone else knows anything else about it I would appreciate any help.
 
Knob

Thank you for your response, that was indeed the issue and it is resolved and working now. Thank you for the original fix and your follow up.

cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top