×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

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!

*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

Invalid procedure call or argument???? help please

Invalid procedure call or argument???? help please

Invalid procedure call or argument???? help please

(OP)
cant figure this one out, i keep getting this error

' Global variable declarations
Global g_HostSettleTime%
Global g_szPassword$

Sub Main()
'--------------------------------------------------------------------------------
' Get the main system object
Dim Sessions As Object
Dim System As Object
Dim MyScreen As Object
Dim sSIN As String
Dim oRange As Object
Dim lNumber As Long
Set oRange = ThisWorkbook.Worksheets(1).Range("I:I")
lNumber = Application.WorksheetFunction.CountA(oRange)
Set System = CreateObject("EXTRA.System") ' Gets the system object
If (System Is Nothing) Then
MsgBox "Could not create the EXTRA System object. Stopping macro playback."
Stop
End If
Set Sessions = System.Sessions

If (Sessions Is Nothing) Then
MsgBox "Could not create the Sessions collection object. Stopping macro playback."
Stop
End If
'--------------------------------------------------------------------------------
' Set the default wait timeout value
g_HostSettleTime = 75 ' milliseconds

OldSystemTimeout& = System.TimeoutValue
If (g_HostSettleTime > OldSystemTimeout) Then
System.TimeoutValue = g_HostSettleTime
End If

' Get the necessary Session Object
Dim Sess0 As Object
Set Sess0 = System.ActiveSession
If (Sess0 Is Nothing) Then
MsgBox "Could not create the Session object. Stopping macro playback."
Stop
End If
If Not Sess0.Visible Then Sess0.Visible = True
Sess0.Screen.WaitHostQuiet (g_HostSettleTime)

RestartSIN:

sSIN = CStr(ThisWorkbook.Worksheets(1).Cells("I3").Value) <---error on this line

Select Case VBA.Len(sSIN)
Case 9

MyScreen.MoveTo 12, 43
MyScreen.SendKeys sSIN
MyScreen.SendKeys "<Enter>"
Do Until MyScreen.WaitHostQuiet(g_HostSettleTime) = True
DoEvents
Loop

End Select
System.TimeoutValue = OldSystemTimeout


End Sub

RE: Invalid procedure call or argument???? help please

Hi,

ThisWorkbook is an Excel Workbook Object.

Your Extra VB code has no reference at the Excel Application Object and consequently no reference to ANY other objects that inherit the properties of the Excel Application Object!

You must use either use CreateObject() or GetObject() to instantiate the Excel Application Object.

RE: Invalid procedure call or argument???? help please

(OP)
I have an account # in I9 in an excel sheet and when i press a button on the excel sheet. That account # is entered on Attachmate and displays the account information. Can you please help me with this code. Thanks in advance

RE: Invalid procedure call or argument???? help please

Why do you have TWO threads related to the same code?

The other one I answered related to the screen navigation as a primary issue .

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