Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PCOMM not working

Status
Not open for further replies.

moving

Programmer
Aug 26, 2001
4
US
I mistakenly posted to the VB Script forum and I was directed to post to this forum (VBA). Here are my problems.

Using VB in Word I get the error message "ECL37130. Invalid host session specified" when I use the .Maximize method of the autECLWinMetrics class.

Also, nothing shows in a valid text field in the AS400 screen when I use the .SendKeys method of the autECLPS class.

However the .autECLConnList.Count method of the autECLConnMgr class is working and the .Alphanumeric method of the autECLOIA class is working. Thus some PCOMM classes are working and others are not. Here are excerpts from my code where these four classes are created:

Sub autECLWinMetricsTest()
'This sub errors out
Dim autECLWinObj As Object
Dim ConnList As Object
Set autECLWinObj = CreateObject("PCOMM.autECLWinMetrics")
Set ConnList = CreateObject("PCOMM.autECLConnList")
' Initialize the connection
ConnList.Refresh
autECLWinObj.SetConnectionByHandle (ConnList(1).Handle)
'Set to maximized if not, if maximized set to minimized
If (autECLWinObj.Maximized) Then 'Here I get the error "ECL37130. Invalid host session specified"
autECLWinObj.Minimized = False
Else
autECLWinObj.Maximized = True
End If
End Sub

Sub autECLConnMgrTest()
'This sub works fine
Dim Mgr As Object
Dim Num As Long
Set Mgr = CreateObject("PCOMM.autECLConnMgr")
Mgr.autECLConnList.Refresh
Num = Mgr.autECLConnList.Count
MsgBox Num
End Sub

Sub autECLPSTest()
'SendKeys does not error out, but the sendkeys text does not show in a vaild text field in the AS400 screen.
Dim autECLPSObj As Object
Dim autECLConnList As Object
Set autECLPSObj = CreateObject("PCOMM.autECLPS")
Set autECLConnList = CreateObject("PCOMM.autECLConnList")
' Initialize the connection
autECLConnList.Refresh
autECLPSObj.SetConnectionByHandle (autECLConnList(1).Handle)
autECLPSObj.SendKeys "123" 'This text does not show in a valid text field on the AS400 screen
End Sub

Sub autECLOIATest()
'This sub works fine
Dim autECLOIA As Object
Dim autECLConnList As Object
Set autECLOIA = CreateObject("PCOMM.autECLOIA")
Set autECLConnList = CreateObject("PCOMM.autECLConnList")
' Initialize the connection
autECLConnList.Refresh
autECLOIA.SetConnectionByHandle (autECLConnList(1).Handle)
If autECLOIA.Alphanumeric Then
MsgBox "Alphanumeric"
Else
MsgBox "Not Alphanumeric"
End If
End Sub

The methods of the two meclasses autECLWinMetrics and autECLP only fail on computers using Word 2002 and Word 2003 Professional Edition, but work fine on computers using 2003 Standard Edition, so I am stumped. All of our AS400 systems use the same version of AS400 and have the same Service Packs installed.

Any help would be greatly appreciated.

Thank you.

Mitch Rabushka
 
The following VB code uses a PCOMM class to send the text "123" to the AS400 User Interface from Word 2003 Standard Edition, but it doesn't work in Word 2002 or Word 2003 Professional Edition. It appears as though Word 2002 and Word 2003 Professional Edition have some issues with COM. Any help would be appreciated.

Sub autECLPSTest()
Dim autECLPSObj As Object
Dim autECLConnList As Object
Set autECLPSObj = CreateObject("PCOMM.autECLPS")
Set autECLConnList = CreateObject("PCOMM.autECLConnList")
' Initialize the connection
autECLConnList.Refresh
autECLPSObj.SetConnectionByHandle (autECLConnList(1).Handle)
autECLPSObj.SendKeys "123"
End Sub

Thank you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top