I have novice knowledge working with PCOMM on the AS400. I have written 15 VBA scripts in Excel which calls AS400 Macros. To get the programs to work the AS400 has to be at the Login Screen and the Active Host Session MUST be set at "D". It is the Host Session that is giving me the blues. As there are many using the same PC, I never know which Host Session the AS400 will active at any point in time... sometimes "A", sometimes "B", or there may be multiple open sessions on the same screen.
The top few lines of my VBA script is below. Is there a way I can define the script to avoid using the Host Session ID ("D" in this case) so my script will work with any ID ("A" or "B", etc)
Sub APVCHDET()
Set autECLSession = CreateObject("PCOMM.autECLSession")
autECLSession.SetConnectionByName ("D")
> enter image description here
The top few lines of my VBA script is below. Is there a way I can define the script to avoid using the Host Session ID ("D" in this case) so my script will work with any ID ("A" or "B", etc)
Sub APVCHDET()
Set autECLSession = CreateObject("PCOMM.autECLSession")
autECLSession.SetConnectionByName ("D")
> enter image description here