WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: mats.jepsen@mastergron.se on February 02, 2020, 08:22:37 PM

Title: Bad Channel using DDE
Post by: mats.jepsen@mastergron.se 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
Title: Re: Bad Channel using DDE
Post by: td 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. 
Title: Re: Bad Channel using DDE
Post by: mats.jepsen@mastergron.se 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

Title: Re: Bad Channel using DDE
Post by: td 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.