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

Invalid procedure call or argument???? help please

Status
Not open for further replies.

Biznez

Technical User
Apr 9, 2015
106
CA
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
 
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.
 
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
 
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 .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top