I'm using the program dde excel to text to help me output data but when I run the program it outputs to a single column. I'm reading 7 columns per row and Using the fputs command, the program outputs all 7 columns in a single row to one column in a text file instead of 7 columns seperated by commas. What commands do I need to be using to do what I am explaining. Below is the part of the script I'm trying to modify. I'm sure this is something so simple, at least I hope it is. Thanks for the help...
;************************************************************************
;* *
;* Procedure RunDDE *
;* *
;* This Procedure Executes the Procomm DDE Commands to Transfer the *
;* Data From the Excel File to an Text File. *
;* *
;************************************************************************
Proc RunDDE
long LinkVar, SystemVar ;* Variables containing DDE Id's.
fopen 1 "C:\Excel_Test_Text.txt" Create ;* RAW MODE
if ddeinit SystemVar "excel" "system"
ddeexecute SystemVar "[APP.MINIMIZE()]" ;* Minimize Excel
if ddeinit LinkVar "excel" "DNB Master List" ;* Link to Sheet 1
While Ro < 550 ;* Last Row in Excel
strfmt sOne "%s%d%s%d" sStrR Ro sStrC C1
strfmt sTwo "%s%d%s%d" sStrR Ro sStrC C2
strfmt sThr "%s%d%s%d" sStrR Ro sStrC C3
strfmt sFou "%s%d%s%d" sStrR Ro sStrC C4
strfmt sFiv "%s%d%s%d" sStrR Ro sStrC C5
strfmt sSix "%s%d%s%d" sStrR Ro sStrC C6
strfmt sSev "%s%d%s%d" sStrR Ro sStrC C7
;*** GET THE DATA FROM THE ROWS AND COLUMNS IN EXCEL ****
Dderequest LinkVar sOne sTok1
;fputs 1 sTok1
Dderequest Linkvar sTwo sTok2
fputs 1 sTok2
Dderequest Linkvar sThr sTok3
fputs 1 sTok3
Dderequest Linkvar sFou sTok4
fputs 1 sTok4
Dderequest Linkvar sFiv sTok5
fputs 1 sTok5
Dderequest Linkvar sSix sTok6
fputs 1 sTok6
Dderequest Linkvar sSev sTok7
fputs 1 sTok7
pause 1 ;* Slows Transfer Rate Down to Excel for Demo ONLY !
Ro++ ;* Increment Row Number
Endwhile
fclose 1
;************************************************************************
;* *
;* Procedure RunDDE *
;* *
;* This Procedure Executes the Procomm DDE Commands to Transfer the *
;* Data From the Excel File to an Text File. *
;* *
;************************************************************************
Proc RunDDE
long LinkVar, SystemVar ;* Variables containing DDE Id's.
fopen 1 "C:\Excel_Test_Text.txt" Create ;* RAW MODE
if ddeinit SystemVar "excel" "system"
ddeexecute SystemVar "[APP.MINIMIZE()]" ;* Minimize Excel
if ddeinit LinkVar "excel" "DNB Master List" ;* Link to Sheet 1
While Ro < 550 ;* Last Row in Excel
strfmt sOne "%s%d%s%d" sStrR Ro sStrC C1
strfmt sTwo "%s%d%s%d" sStrR Ro sStrC C2
strfmt sThr "%s%d%s%d" sStrR Ro sStrC C3
strfmt sFou "%s%d%s%d" sStrR Ro sStrC C4
strfmt sFiv "%s%d%s%d" sStrR Ro sStrC C5
strfmt sSix "%s%d%s%d" sStrR Ro sStrC C6
strfmt sSev "%s%d%s%d" sStrR Ro sStrC C7
;*** GET THE DATA FROM THE ROWS AND COLUMNS IN EXCEL ****
Dderequest LinkVar sOne sTok1
;fputs 1 sTok1
Dderequest Linkvar sTwo sTok2
fputs 1 sTok2
Dderequest Linkvar sThr sTok3
fputs 1 sTok3
Dderequest Linkvar sFou sTok4
fputs 1 sTok4
Dderequest Linkvar sFiv sTok5
fputs 1 sTok5
Dderequest Linkvar sSix sTok6
fputs 1 sTok6
Dderequest Linkvar sSev sTok7
fputs 1 sTok7
pause 1 ;* Slows Transfer Rate Down to Excel for Demo ONLY !
Ro++ ;* Increment Row Number
Endwhile
fclose 1