Jump to content

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?

Link to comment
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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...