troubleshooting Question

How to Slow Down a AS400 .mac Macro when Call Using "StartMacro" Function Within VBA Code

Avatar of Al Rice
Al RiceFlag for United States of America asked on
VBA* PCOMM Macro* AS400Microsoft OfficeMicrosoft 365
8 Comments1 Solution50 ViewsLast Modified:
I am having problems playing back an AS400 (.mac) Macro when my VBA Code calls the .mac file Using the "StartMacro" Function.  The AS400 (.mac) Macro (partially shown below), which includes a lot of "wait" functions  (in bold Italics) runs very fast and does not seem to recognized the waits during execution when using the "StartMacro" Function Within VBA Code.  The same macro runs perfectly when manually, selected from the PC5250 macro menu (Screenshot) in iSeries Access for Windows Menu
          Description =
[wait app]
[wait inp inh]
"20
[enter]
[wait inp inh]
wait 15 sec until FieldAttribute 0000 at (22,6)
wait 15 sec until cursor at (22,7)
[wait app]
[wait inp inh]
"7
[enter]
[wait inp inh]
wait 15 sec until FieldAttribute 0008 at (4,4)
wait 15 sec until cursor at (4,5)
[wait app]
[wait inp inh]
[tab field]
[tab field]
"1
[enter]
[wait inp inh]
wait 15 sec until FieldAttribute 0008 at (4,4)
[wait app]
[wait inp inh]
[pf3]
[wait inp inh]
wait 15 sec until FieldAttribute 0000 at (22,6)
[wait app]
[wait inp inh]
             ...

The PCOMM VBA syntax I am using to execute "StartMacro" is below
   SessObj.autECLPS.StartMacro ('JE#356BSB0421')

The macro runs very fast and throws the following error:
Runtime Error '440'
Emulator interface (ehllapi) error. reason 9
... and then the macro aborts about 3/4 of the way through execution.

Finally, might my problem be related to the VBA code is using PCOMM syntax and the AS400 Macro was created in .mac format, rather that .vbscript format.

Thanks in advance for your experts guidance

Al
ASKER CERTIFIED SOLUTION
Gary Patterson, CISSP
Expert for hire: IBM i, AIX, Linux, Windows, DB2, Performance, Security. EDI

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Log in to continue reading
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform for $9.99/mo
View membership options
Unlock 1 Answer and 8 Comments.
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
The Value of Experts Exchange in My Daily IT Life

Experts Exchange (EE) has become my company's go-to resource to get answers. I've used EE to make decisions, solve problems and even save customers. OutagesIO has been a challenging project and... Keep reading >>

Mike

Owner of Outages.IO
Phoenix, Arizona, United States
Member Since 2016
Join a full scale community that combines the best parts of other tools into one platform.
Unlock 1 Answer and 8 Comments.
View membership options
“All of life is about relationships, and EE has made a virtual community a real community. It lifts everyone's boat.”
William Peck

Member since 2004