Author Topic: Bad Channel using DDE  (Read 124 times)

mats.jepsen@mastergron.se

  • Newbie
  • *
  • Posts: 2
Bad Channel using DDE
« on: February 02, 2020, 08:22:37 pm »
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

  • Tech Support
  • *****
  • Posts: 3210
    • WinBatch
Re: Bad Channel using DDE
« Reply #1 on: February 03, 2020, 07:55:17 am »
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

  • Newbie
  • *
  • Posts: 2
Re: Bad Channel using DDE
« Reply #2 on: February 04, 2020, 08:30:42 am »
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

  • Tech Support
  • *****
  • Posts: 3210
    • WinBatch
Re: Bad Channel using DDE
« Reply #3 on: February 04, 2020, 01:06:35 pm »
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