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!

dde command in excel

Status
Not open for further replies.

ultimate51

Technical User
Jun 9, 2003
1
US
I currently have a procomm script that opens up an excel spreadsheet using DDE and then pokes in some data and starts a macro. Is there a way to notify Procomm using DDE when the macro has completed in Excel?

Thanks for any help
 
You should be able to use the ddeadvise command to have Excel automatically update a variable in your script whenever that value in Excel changes. This may work for you if the value always changes whenever the macro in Excel finishes running.


aspect@aspectscripting.com
 
You could insert a string value into a blank cell in the spreadsheet and then run ddeadvise on that cell. Create a while loop directly after the ddeadvise to make Procomm wait for Excel to complete it's macro. Then, have your Excel macro delete the contents of the cell when you want to return back to Procomm. See example
Code:
ddepoke longvar1 "R1C1" strvar1
ddeadvise longvar1 "R1C1" strvar1
while 1           ; loop while macro is running
   yield
   if $DDEADVISE  ; if cell contents change           
      exitwhile   ; break out of loop & continue.
   endif
endwhile
ddeunadvise longvar1 "R1C1"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top