cant get DDEPoke to work

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
MacschedStudent
Junior Coder
Posts: 36
Joined: Fri Oct 12, 2007 5:55 pm
Location: federal way wa
Contact:

cant get DDEPoke to work

Post by MacschedStudent » Sat Oct 13, 2007 6:55 pm

Hi Guys

Im running MSched 7.4.009
I have tried several different ways to write to an excel spreadsheet without success. I have tried VBScript / as well as VBscript inside Macro scheduler. I have also tried several code examples on the forum. I just tried this one which is almost verbatim of what Marcus wrote in his example the compiled macro ran but nothing happened. Here is the code:


ReadFile>utext.txt,File1
Separate>File1,CRLF,Lines
Let>k=7
Repeat>k
Let>CurrentLine=Lines_%k%
DDEPoke>Excel,e:\test.xls:Sheet1,R%k%C1,CurrentLine
Let>k=k+1
Until>k>Lines_Count






Is there a way to write a stand alone script that does not depend on any external servers. Could there be something wrong with the Excel server on my system??

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Sat Oct 13, 2007 7:28 pm

I copied your code and it worked fine for me (V9). You do have the spreadsheet open - right?

MacschedStudent
Junior Coder
Posts: 36
Joined: Fri Oct 12, 2007 5:55 pm
Location: federal way wa
Contact:

Post by MacschedStudent » Sat Oct 13, 2007 7:50 pm

Thanks for your quick reply

No the spreadsheet is closed - I thought could there be something about the spreadsheet itself so I made a blank one and named it test.xls. The result was the same - the exe ran but nothing happened.

I have an idea can you send me a zip file of your compiled exe so I can rule out software versus possible system problems??

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Sat Oct 13, 2007 8:07 pm

MacschedStudent wrote:No the spreadsheet is closed
It needs to be open for DDE to work.

See:
http://www.mjtnet.com/blog/2007/07/02/m ... xcel-data/

So your script could do:

ExecuteFile>e:\test.xls
WaitWindowOpen>Microsoft Excel*

..
..
DDEPoke>....
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

MacschedStudent
Junior Coder
Posts: 36
Joined: Fri Oct 12, 2007 5:55 pm
Location: federal way wa
Contact:

Post by MacschedStudent » Sat Oct 13, 2007 8:24 pm

thanks for the quick reply Marcus - the results were the same the file opened up but nothing was written to it here is my current code:


ExecuteFile>e:\test.xls
WaitWindowOpen>Microsoft Excel*

ReadFile>utext.txt,File1
Separate>File1,CRLF,Lines
Let>k=7
Repeat>k
Let>CurrentLine=Lines_%k%
DDEPoke>Excel,e:\test.xls:Sheet1,B%k%C1,CurrentLine
Let>k=k+1
Until>k>Lines_Count

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Sat Oct 13, 2007 8:29 pm

It should be:

DDEPoke>Excel,e:\test.xls:Sheet1,R%k%C1,CurrentLine

Row and Column
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

MacschedStudent
Junior Coder
Posts: 36
Joined: Fri Oct 12, 2007 5:55 pm
Location: federal way wa
Contact:

Post by MacschedStudent » Sat Oct 13, 2007 8:34 pm

That was it! Thank you Marcus and Me_again for all of your help.

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