Trying to programmatically automate IBM PCOMM v 14.0 using Host Access Class Library Automation Objects in VBScript through Visual Studio Code IDE:
Option Explicit
Dim autECLPSObj
Dim autECLConnList
Dim autECLOIAObj
Dim PSText
Set autECLPSObj = CreateObject("PCOMM.autECLPS")
Set autECLConnList = CreateObject("PCOMM.autECLConnList")
Set autECLOIAObj = CreateObject("PCOMM.autECLOIA")
' Refresh must be called to get latest connection info
autECLConnList.Refresh
' Initialize the connection with the first in the list
autECLPSObj.SetConnectionByHandle (autECLConnList(1).Handle)
' Initialize the connection with Session Name
autECLOIAObj.SetConnectionByName ("A")
autECLPSObj.SendKeys "PCOMM API’s are very Powerful", 3, 1
'autECLPSObj.SendKeys “[Enter]”
'PSText = GetText(1, 1, 10)
'autECLPSObj.SetCursorPos 2, 1
autECLOIAObj.WaitForInputReady (10000)
Set autECLPSObj = Nothing
Set autECLConnList = Nothing
Set autECLOIAObj = Nothing
Getting the following error: Microsoft VBScript runtime error: ActiveX component can't create object: 'PCOMM.autECLPS'
The PCOMM documentation says Automation will work only using 64-bit version of MS Office.
My current installed versions are:
- Office version is 'Microsoft 365 MSO 64-bit'
- Windows OS: Windows 10 Enterprise (64-bit)
- IBM Personal Communications (PCOMM) version 14.0
Clarification:
- Is the above error due to bit incompatibility? Based on product readme file,I suppose the PCOMM 14.0 is 64 bit version
- How do I determine whether it is 64-bit or 32-bit PCOMM installed?
- I'm not clear whether the Office version and Windows OS should be downgraded to 32 bit version?
PCOMM also should be 64bit version. you can find it by clicking Help > About Personal Communications (on the Menu). (you need to save the macro file on C drive.) Both office and PCOMM bit versions should be same.