Bad Channel using DDE

Started by mats.jepsen@mastergron.se, February 02, 2020, 08:22:37 PM

Previous topic - Next topic

mats.jepsen@mastergron.se

I'm getting errormessage using DDERequest(channel,(pos.no)). I added a printscreen to show the error.
It's very frustrating.. I have been using the script a lot in the early 20th.
I'm running Win10.

Have you got any idea?

Kind Regards
Mats Jepsen

td

Haven't encountered a DDE question in a very long time.  Generally, users favor COM Automation over the much older DDE technology.  This is particularly true of Excel automation-related scripts.

The immediate reason for your error is that you are passing the  DDERequest function an invalid channel number.  You are passing it 0 and it must be between 1 and 10.  Assuming that you are using the output of  DDEInitiate for your channel number, you could be passing the DDEInitiate function an invalid application name or an invalid topic name. 
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

mats.jepsen@mastergron.se

Hi Tom, thx for your reply.

I managed to fix the problem (at least for the time being) by doing a new DDEInitate just before the DDERequest, probably he got a new channel or something.
I got the script sometime back in 2002 and at that time maybe it was just the DDE that was available. Anyhow as you write - it's a bit oldfashioned.

If you know where I can get hold of some codes doing the same job with modern techniques, I would appreciate that a lot.

The script is reading an excelfile extracted from an iSeries application, so you have to clean the cells in the excelfile, and then sends it into an ERP-system, also runned on the iSeries, sends it in via the UserInterface of the ERP-system.

Not very complicated in my opinion.

Kind Regards
Mats Jepsen


td

Search on the term "Excel" in the Tech Database. You should be able to find something useful.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade