Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


VBA to access AS400 - ConnList comes back as zero

VBA to access AS400 - ConnList comes back as zero

VBA to access AS400 - ConnList comes back as zero

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:


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


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.

RE: VBA to access AS400 - ConnList comes back as zero

I found a source-code download available at http://www.itjungle.com/mpo/mpo061903-story02.html that might be helpful to you.

I haven't used this method myself, (moved from EHLLAPI to ODBC), but it looks like it might be an interesting experiment.

Good luck.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close