viewpoint-particle

Author Topic: Using Extender Issues  (Read 655 times)

juankalsa

  • Newbie
  • *
  • Posts: 8
Using Extender Issues
« on: December 16, 2019, 04:51:51 pm »
Hello Team.

We have some scripts using EHLLAPI Extenders with 2016 and 2019 Winbatch versions.

This scripts connect Excel and AS400 Application.

Last week the script stop working showing this kind of errors.

(See attachment)

I had to use several TimeDelay(.5) and TimeDelay(3) but I have 8 different scripts and this make a processing time to be augmented by almost 45 minutes.

We also have

;Command to allow CTRL-BREAK to stop the script.
IntControl(12,4,0,0,0)

;Command to wait 2000 milliseconds before each communication with a PC application, which is Excel and the host emulator in this script.
;This was found to make the script run more reliably.
IntControl(35,2000,0,0,0)

But I do not understand what this IntControl makes and I found no documentation related to.

Does anyone have a similar situation?

I have 2 years learning about winbatch scripting documentation based and I have no clue on what's next.

Thanks.

juankalsa

  • Newbie
  • *
  • Posts: 8
Re: Using Extender Issues
« Reply #1 on: December 16, 2019, 04:52:33 pm »
Here the issue.

td

  • Tech Support
  • *****
  • Posts: 3464
    • WinBatch
Re: Using Extender Issues
« Reply #2 on: December 16, 2019, 05:04:35 pm »
Both IntControl 12 and IntControl 35 are documented in the Consolidated WIL Help file.  There is no reason to repeat their purpose here (likely with typos...) 

If your scripts stopped working, you need to ask yourself what changed.  Is it a network issue, an OS update of some kind, a security policy change or something else?     
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

nrr

  • Newbie
  • *
  • Posts: 10
Re: Using Extender Issues
« Reply #3 on: December 17, 2019, 06:33:54 am »
I don't believe you can reliably use TimeDelay() when attempting to communicate with a host application using ehllapi.  Your program should be using extender commands such as ehllapiWait which waits for the presentation space to be available.  Then use other commands such as ehllapiFindFieldPos() and ehllapiCopyTextToField() to reliable enter data into the host application.

td

  • Tech Support
  • *****
  • Posts: 3464
    • WinBatch
Re: Using Extender Issues
« Reply #4 on: December 17, 2019, 07:40:50 am »
Good advice.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

juankalsa

  • Newbie
  • *
  • Posts: 8
Re: Using Extender Issues
« Reply #5 on: December 17, 2019, 11:24:42 am »
I don't believe you can reliably use TimeDelay() when attempting to communicate with a host application using ehllapi.  Your program should be using extender commands such as ehllapiWait which waits for the presentation space to be available.  Then use other commands such as ehllapiFindFieldPos() and ehllapiCopyTextToField() to reliable enter data into the host application.

Yes I guess it should be some windows updates but I work for a IT Managed enviroment :(

juankalsa

  • Newbie
  • *
  • Posts: 8
Re: Using Extender Issues
« Reply #6 on: December 17, 2019, 11:26:55 am »
I don't believe you can reliably use TimeDelay() when attempting to communicate with a host application using ehllapi.  Your program should be using extender commands such as ehllapiWait which waits for the presentation space to be available.  Then use other commands such as ehllapiFindFieldPos() and ehllapiCopyTextToField() to reliable enter data into the host application.

This is pretty much a good advice However I notice that the issue in not with the host itself, most likely 99% of errors are related to the excel input/output.

So if there is any ehllapiwait that actually works in excel could be awesome.

nrr

  • Newbie
  • *
  • Posts: 10
Re: Using Extender Issues
« Reply #7 on: December 17, 2019, 11:47:34 am »
I've never had issues with "waiting" for Excel.  Once it initializes, it's consistently available.  Can you debug this through the debugger?  Just guessing but perhaps the value of your RowNumber +1 or WorkItemCol variables has become invalid.

juankalsa

  • Newbie
  • *
  • Posts: 8
Re: Using Extender Issues
« Reply #8 on: December 17, 2019, 01:19:01 pm »
I've never had issues with "waiting" for Excel.  Once it initializes, it's consistently available.  Can you debug this through the debugger?  Just guessing but perhaps the value of your RowNumber +1 or WorkItemCol variables has become invalid.

Thank you for your answer.

Actually we do not change anything, If I use the debugger it takes more time to complete but it works fine, when I run the script the issue raise. That's why as a workaround I use the TimeDelay but some points I can use the TimeDelay on .5 but some other points I have to use up to 8 seconds :(

ChuckC

  • Full Member
  • ***
  • Posts: 248
Re: Using Extender Issues
« Reply #9 on: December 18, 2019, 09:42:48 am »
As the original author of the EHLLAPI extender, I can confidently make the statement that the time delay operations in a WinBatch script have no direct effect on the operation of the EHLLAPI programming interface that is used to allow a WinBatch scrpt to interact with a 3270/5250 terminal emulator.  The only effect that it might have is change the point in time at which a screen-scraping key-send operation occurs and whether or not host application in an appropriate state for the screen content to be appropriate or for the key to be sent to be acknowledged by the host application.

I also noted that the WinBatch pop-up error message indicated a COM-related error had occurred, which has to do with Excel, not with the EHLLAPI extender.  Whatever is going wrong with the communication with Excel via COM is producing that error message and the underlying root cause needs to be identified.


juankalsa

  • Newbie
  • *
  • Posts: 8
Re: Using Extender Issues
« Reply #10 on: December 19, 2019, 02:08:56 am »
As the original author of the EHLLAPI extender, I can confidently make the statement that the time delay operations in a WinBatch script have no direct effect on the operation of the EHLLAPI programming interface that is used to allow a WinBatch scrpt to interact with a 3270/5250 terminal emulator.  The only effect that it might have is change the point in time at which a screen-scraping key-send operation occurs and whether or not host application in an appropriate state for the screen content to be appropriate or for the key to be sent to be acknowledged by the host application.

I also noted that the WinBatch pop-up error message indicated a COM-related error had occurred, which has to do with Excel, not with the EHLLAPI extender.  Whatever is going wrong with the communication with Excel via COM is producing that error message and the underlying root cause needs to be identified.

Hi Chuck, thank you so much for your reponse.

Yes, actually I'm currently working with this script and issue persist, I'm pretty sure is more related to some Excel/Windows updates because i.e. the one I have at this momento is that do not have enough time to send the save process to excel :facepalm:

BTW thank you for such amazing Ehlappi feature, more than 10 years up and running and excel is the one creating the conflict.

I use AS390 with Personal Communications Software!

Thanks you sir!

@Forum, anyone that is currently this kind of issues excel related?

Thanks.

nrr

  • Newbie
  • *
  • Posts: 10
Re: Using Extender Issues
« Reply #11 on: December 19, 2019, 06:33:19 am »
Is your Excel file on a network drive?  If so, I would look there as a potential intermittent failure.

nrr

  • Newbie
  • *
  • Posts: 10
Re: Using Extender Issues
« Reply #12 on: December 19, 2019, 06:37:01 am »
ChuckC ... I also offer my thanks for the ehllappi extender.  I've used it quite a bit over the years at different client sites.

juankalsa

  • Newbie
  • *
  • Posts: 8
Re: Using Extender Issues
« Reply #13 on: December 19, 2019, 03:55:46 pm »
Is your Excel file on a network drive?  If so, I would look there as a potential intermittent failure.

Local File, we create every day different excel files, we process a lot of files a week lol

juankalsa

  • Newbie
  • *
  • Posts: 8
Re: Using Extender Issues
« Reply #14 on: December 23, 2019, 07:00:12 am »
Update,

I just reinstall Office and appears is working fine, I'm allowing a whole week expecting for errors.

next step Windows fresh install.

Thanks!