Jump to content
MaksimK

Unable to create AS400 PCOMM object

Recommended Posts

Like many here i am very new to AutoIT and to programming in general.

I am working for a company that uses AS400 for work and there are many repetitive data entry tasks we do where i feel automation can greatly benefit the company.

As such i began my journey into the world of AutoIT.

This is my current script:

#include <MsgBoxConstants.au3>
Local $oErrorHandler = ObjEvent("AutoIt.Error", "_ErrFunc")

ShellExecute("C:\ProgramData\IBM\Client Access\Emulator\private\AS4001.ws")
WinWaitActive("IBM i signon")
ControlSend("IBM i signon", "", "[CLASS:Edit; INSTANCE:2]", "MASKED USERNAME")
ControlSend("IBM i signon", "", "[CLASS:Edit; INSTANCE:3]", "MASKED PASSWORD")
ControlClick("IBM i signon", "", "[CLASS:Button; TEXT:OK; INSTANCE:1]")
global $oPS = ObjCreate("PCOMM.autECLPS")
If @error Then MsgBox($MB_SYSTEMMODAL, "COM Error", "@error = 0x" & Hex(@error))

 

When i run the script, emulator starts and automatically signs on but then the error message pops up:

@error = 0x80040154

if i add one more command to the script:

$oOIA.SetconnectionByName("A") 

and remove

If @error Then MsgBox($MB_SYSTEMMODAL, "COM Error", "@error = 0x" & Hex(@error))

i get 

$oOIA.SetconnectionByName("A)

$oOIA.SetconnectionByName("A")^ ERROR

Error: Unable to parse line.

Is there something i am missing on my PC to get this to work? Possibly a DLL needs to be registered?

Share this post


Link to post
Share on other sites

HRESULT 0x80040154 (REGDB_E_CLASSNOTREG) tells you that the class is not registered.
Means: You either call the wrong class or the software dos not provide a COM interface (which is often the case for trial or free versions of a software).


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2020-10-10 - Version 1.5.2.1) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2020-06-30 - Version 1.6.2.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (NEW 2020-06-27 - Version 1.3.2.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki, WebDriver - Wiki

 

Share this post


Link to post
Share on other sites

Did you search the forum for PCOMM? You get a lot of hits ;)
Seems the first step is to create a session. Example:

 


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2020-10-10 - Version 1.5.2.1) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2020-06-30 - Version 1.6.2.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (NEW 2020-06-27 - Version 1.3.2.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki, WebDriver - Wiki

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...