When I run the below code I cannot pass "Qty" to BlueZone. It will successfully pass the for each variable "aisle" using SendKey within the loop. I tested the outputs on the active sheet and I get the values based on myRange.Offset(0,n).
I have an n x 4 array that I want to loop through. I need to pass a different set of variables for each iteration.
Is my structure wrong?
BlueZone is terminal emulation.
Sub Grooming1()
Dim bzhao As Object
Set bzhao = CreateObject("BZWhll.WhllObj")
bzhao.Connect ""
Dim aisle As Variant
Dim Qty As Variant
Dim LDAP As Variant
Dim Priority As Variant
Set myRange = ActiveSheet.Range("A2:A1000")
'Set myQty = ActiveSheet.Range("B2:B1000")
'Set myLDAP = ActiveSheet.Range("C2:C1000")
'Set myPriority = ActiveSheet.Range("D2:D1000")
For Each aisle In myRange
Set Qty = myRange.Offset(0, 1)
Set LDAP = myRange.Offset(0, 2)
Set Priority = myRange.Offset(0, 3)
'end loop at blank cell
If aisle = "" Then
Exit For
End If
bzhao.SendKey "<PF3>"
bzhao.Wait 0.5
bzhao.SendKey Qty '<---ERROR
bzhao.Wait 0.5
'ActiveSheet.Range("F2") = Qty
'ActiveSheet.Range("F3") = LDAP
'ActiveSheet.Range("F4") = Priority
'ActiveSheet.Range("F5") = aisle
Next aisle
End Sub
So, my company uses BlueZone as well. We have created a function that reduces lines of code:
End Function So when you want to enter text into BlueZone: