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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA to access AS400 - ConnList comes back as zero

Status
Not open for further replies.

dmg197243

Programmer
Jul 4, 2007
4
US
I am writing some VBA code to read values from an excel file, put those values into an AS400 window and then scrape some values off that AS400 window. I am using VBA 6.0, and IBM Iseries Access for Windows (PCOMM) v5.7.

My code, so far, is as follows:

Code:
Public Sub TestRoutine()

Dim PS As AutPS
Dim IA As AutOIA
Dim SessionList As AutConnList

Set SessionList = CreateObject("pcomm.auteclconnlist")

NumberOfSessions = SessionList.Count

Set IA = CreateObject("PCOMM.autECLOIA")
Set PS = CreateObject("PCOMM.autECLPS")

IA.SetConnectionByName ("A")
PS.SetConnectionByName ("A")

PS.SendKeys "504878", 3, 11

Stop

End Sub

However, the SessionList count always comes back as zero so when the SetConnectionByName attempts to execute it generates a run-time error.

I have an active PCOMM session running and on the desired screen when I run this code.

Suggestions, anyone?

Thank you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top