Ojbect Defined Error
Ojbect Defined Error
(OP)
I'm getting this error on this piece of code What I'm trying to do it get data from a queue in Extra and put it into excel. I'm not taking anything from excel to start, just going through the queue and hit alt8 to move to the next account. I'm also not sure what loop and if/else statement I will need to use. There are multiple queues some are 100 accounts, some are 5000 accounts so I'm not sure how to determine the end of the queue. Code is below. Thanks
CODE
ws.Cells(x, 1) = acct_num
CODE
Sub queues()
Dim Sessions, System As Object, Sess0 As Object
Set System = CreateObject("EXTRA.System")
Set Sessions = System.Sessions
Set Sess0 = System.ActiveSession
Dim ws As Worksheet
Set ws = ActiveWorkbook.Sheets("Sheet1")
acct_num = Sess0.Screen.GetString(3, 19, 10)
ws.Cells(x, 1) = acct_num
hold_date = Sess0.Screen.GetString(21, 26, 8)
ws.Cells(x, 2) = hold_date
hold_reason = Sess0.Screen.GetString(21, 44, 1)
ws.Cells(x, 3) = hold_reason
deman_exp = Sess0.Screen.GetString(4, 16, 8)
ws.Cells(x, 4) = demand_exp
Sess0.Screen.SendKeys ("<pf8>")
Sess0.Screen.WaitHostQuiet (g_HostSettleTime)
End Sub
Dim Sessions, System As Object, Sess0 As Object
Set System = CreateObject("EXTRA.System")
Set Sessions = System.Sessions
Set Sess0 = System.ActiveSession
Dim ws As Worksheet
Set ws = ActiveWorkbook.Sheets("Sheet1")
acct_num = Sess0.Screen.GetString(3, 19, 10)
ws.Cells(x, 1) = acct_num
hold_date = Sess0.Screen.GetString(21, 26, 8)
ws.Cells(x, 2) = hold_date
hold_reason = Sess0.Screen.GetString(21, 44, 1)
ws.Cells(x, 3) = hold_reason
deman_exp = Sess0.Screen.GetString(4, 16, 8)
ws.Cells(x, 4) = demand_exp
Sess0.Screen.SendKeys ("<pf8>")
Sess0.Screen.WaitHostQuiet (g_HostSettleTime)
End Sub
RE: Ojbect Defined Error
Hi,
Is this coded in Excel VBA?
What is the value of x when the error occurs?
Skip,
Just traded in my old subtlety...
for a NUANCE!
RE: Ojbect Defined Error
END OF SELECTION QUEUE
So I guess I would do a Do Until Loop until I get that message???
RE: Ojbect Defined Error
RE: Ojbect Defined Error
RE: Ojbect Defined Error
CODE
Dim Sessions, System As Object, Sess0 As Object
Set System = CreateObject("EXTRA.System")
Set Sessions = System.Sessions
Set Sess0 = System.ActiveSession
Dim ws As Worksheet
Set ws = ActiveWorkbook.Sheets("Sheet1")
r = 2
Do
r = r + 1
acct_num = Sess0.Screen.GetString(3, 19, 10)
ws.Cells(r, 1) = acct_num
hold_date = Sess0.Screen.GetString(21, 26, 8)
ws.Cells(r, 2) = hold_date
hold_reason = Sess0.Screen.GetString(21, 44, 1)
ws.Cells(r, 3) = hold_reason
deman_exp = Sess0.Screen.GetString(4, 16, 8)
ws.Cells(r, 4) = demand_exp
unapp_funds = Sess0.Screen.GetString(12, 55, 13)
ws.Cells(r, 5) = unapp_funds
loan_type = Sess0.Screen.GetString(12, 14, 3)
ws.Cells(r, 6) = loan_type
Sess0.Screen.SendKeys ("<pf8>")
Sess0.Screen.WaitHostQuiet (g_HostSettleTime)
Loop Until Sess0.Screen.GetString(24, 2) = "E"
End Sub
RE: Ojbect Defined Error
X is empty
CODE
No wonder you got an error!!!
Skip,
Just traded in my old subtlety...
for a NUANCE!
RE: Ojbect Defined Error
RE: Ojbect Defined Error
CODE
Do
r = r + 1
CODE
Sub queues()
Application.ScreenUpdating = False
Dim Sessions, System As Object, Sess0 As Object
Set System = CreateObject("EXTRA.System")
Set Sessions = System.Sessions
Set Sess0 = System.ActiveSession
Dim ws As Worksheet
Set ws = ActiveWorkbook.Sheets("Sheet1")
done = Sess0.Screen.GetString(24, 2, 3)
queue = Sess0.Screen.GetString(2, 10, 11)
If done <> "END" And queue <> "F0009 / 11" Then
x = 1
Do
Sess0.Screen.MoveTo 6, 67
Sess0.Screen.SendKeys ("f000")
Sess0.Screen.SendKeys (x)
Sess0.Screen.MoveTo 7, 67
Sess0.Screen.SendKeys ("001")
Sess0.Screen.SendKeys ("<enter>")
Sess0.Screen.WaitHostQuiet (g_HostSettleTime)
r = 1
Do
r = r + 1
acct_num = Sess0.Screen.GetString(3, 19, 10)
ws.Cells(r, 1) = acct_num
hold_date = Sess0.Screen.GetString(21, 26, 8)
ws.Cells(r, 2) = hold_date
hold_reason = Sess0.Screen.GetString(21, 44, 1)
ws.Cells(r, 3) = hold_reason
done2 = Sess0.Screen.GetString(24, 2, 3)
Sess0.Screen.SendKeys ("<pf8>")
Sess0.Screen.WaitHostQuiet (g_HostSettleTime)
Loop Until done2 = "END"
Sess0.Screen.SendKeys ("<pf3>")
Sess0.Screen.WaitHostQuiet (g_HostSettleTime)
x = x + 1
Loop Until x = 9
End If
End Sub
RE: Ojbect Defined Error
RE: Ojbect Defined Error
Assuming that your Excel table is contiguous with A1...
CODE
r = 1
r = ws.cells(1,1).currentregion.rows.count + 1
Do
Skip,
Just traded in my old subtlety...
for a NUANCE!
RE: Ojbect Defined Error
CODE
x = 1
r = 1 ' moved r=1 from outside the loop
Do
Sess0.Screen.MoveTo 6, 67
Sess0.Screen.SendKeys ("f000")
Sess0.Screen.SendKeys (x)
Sess0.Screen.MoveTo 7, 67
Sess0.Screen.SendKeys ("001")
Sess0.Screen.SendKeys ("<enter>")
Sess0.Screen.WaitHostQuiet (g_HostSettleTime)
Do
r = r + 1
acct_num = Sess0.Screen.GetString(3, 19, 10)
ws.Cells(r, 1) = acct_num
RE: Ojbect Defined Error
That would work, too.
I often have instances where an indeterminate number or rows might be added, which is why I use the technique I posted.
Skip,
Just traded in my old subtlety...
for a NUANCE!