@Satid it appears there is no way to launch the Host On Demand Macros programmatically.
There is a java class available for Host On Demand for programmatically interacting with the terminal but it appears in ACS this functionallity was not exposed in ACS so macros have to be run manually. Seems to me that this is a blatant omission of important macro functionality when the Host On Demand terminal code was re-purposed for ACS. Users should be able to trigger macros externally/automatically in my opinion.
Original Message:
Sent: Wed April 12, 2023 11:24 AM
From: Richard Schoen
Subject: How to Call stored Hascript from Excel Macro?
Answered previously: I don't believe there is a way to do so if you're talking about IBM Access Client Solutions. You have to launch macros manually.
HLLAPI is different than the VBA macros available in the old Client Access/IBM i Access/Personal Communications. I don't believe just installing EHLLAPI32.DLL will work unless you plan to learn how to use HLLAPI APIs which are substantially more intricate.
Buy a few personal communications licenses and be done with it :-)
------------------------------
Richard Schoen
Original Message:
Sent: Wed April 12, 2023 11:09 AM
From: Al Rice
Subject: How to Call stored Hascript from Excel Macro?
Just to circle back to my original question. If I have developed a Hascript macro on the AS400, is it possible to automatically call the Hascript procedure from within Excel using an Excel macro (VBA). Just trying to effect some level of automation from within Excel.
Additionally, I was told if IT installs the EHLLAPI32.DLL patch on IBM i Access Client Solutions, then the old Excel VBA macros will still run (with minor changes). The VBA macros would need declare the path to the EHLLAPI32.DLL from within the VBA macro. Can anyone confirm this, and can share some sample code.
I believe I am getting closer to leveraging the substantial investment in VBA/VBS scripting.
Thanks for the good guidance...
------------------------------
Al Rice
Original Message:
Sent: Wed April 12, 2023 08:59 AM
From: Satid Singkorapoom
Subject: How to Call stored Hascript from Excel Macro?
Dear Al and Richard
>>>> Maybe someone from IBM can provide feedback on why this feature isn't available because it severely limits automation with ACS. <<<<
This IBM Technote IBM i Access Client Solutions 5250 Macro Scripting at https://www.ibm.com/support/pages/ibm-i-access-client-solutions-5250-macro-scripting has this to say :
[QUOTE]
Many users have created Macros in the Access for Windows PC5250 environment. The macros were created in a .mac or .vbs format. The macros created by capturing the mouse and keyboard input will import using the macro conversion utility in IBM i Access Client Solutions. However, many administrators have created custom scripts written to accomplish various tasks. If customized scripts have been created, the macro conversion utility will not work. You must start over using the new Host On-Demand Macro Programming language. The reason for this change is simple. It is now multi-platform; Linux and Mac have no idea what VBScript is.
[UNQUOTE]
This seems to support Richard's suggestion to use PCOMM instead to run your macro.
------------------------------
Education is not the learning of facts but the training of the mind to think. -- Albert Einstein.
------------------------------
Satid S.
Original Message:
Sent: Sat April 08, 2023 10:45 PM
From: Al Rice
Subject: How to Call stored Hascript from Excel Macro?
Could some one provide guidance on calling stored Hascript or .mac macros on the AS400 from an Excel macro. I would like to automate interaction between Excel and the AS400 without leaving Excel. As such, all the AS400 navigation will be managed with the recorded hascript or .mac macro.
I would have an active AS400 session started, and the .mac macro will logon the AS400 executed certain steps (eg. execute wrkqry or run a report) and then log off the AS400. Further, I may want to post data from/to Excel during the AS400 session.
Thanks in advance for any help.
Al
------------------------------
Al Rice
------------------------------