WRQ Reflection/VBA programming

cshivers

New Member
Joined
Mar 1, 2010
Messages
34
Does anyone have any experience using VBA with WRQ Reflection? I have tried multiple searches related to WRQ Reflection and VBA with no luck on figureing out how to use VBA to access WRQ Reflection. I cant find how to even connect let alone start sending commands do and from. Right now i am just trying to establish a connection or anything. Any Help is appreciated. Thank you.
 
No i did not look at the screen shots, i am at work and it would not have let me....but this code should work if all your doing is cutting and pasting from columns B & C till you run out of lines.....

Glad to help.....:)
 
Upvote 0

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
well bro bless your smile..
i tried to run it....
it gave error.... i cleared End without With by removing With but Next with out for!! is over my head :D
.MoveCursor 4, 11
End With <<<< give error of :End without With>>>
z = excelApp.ActiveSheet.Range("C" & x).Copy
With Session
.WaitForEvent rcEnterPos, "30", "0", 4, 11
.WaitForDisplayString "SEALS..:", "30", 4, 2
.Paste
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
Next x <<< gave error of : Next without For>>>>
End With

End With
End With
End Sub
 
Upvote 0
Yeah there were a few too many with's in there...try this one....

<CODE>
<CODE>
</CODE></CODE>
Code:
Sub macro_22333()
Dim excelApp As Object
Dim z As Integer
Dim LR as Integer
Set excelApp = GetObject(, "Excel.Application")
Set excelApp = GetObject("C:\Documents and Settings\mintezar\Desktop\Book1.xlsx")
With Session
.WaitForEvent rcEnterPos, "30", "0", 1, 1
.TransmitTerminalKey rcIBMPf9Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 5, 13
.WaitForDisplayString "==>", "30", 5, 9
.TransmitANSI "1"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 18, 33
.WaitForDisplayString "ID:", "30", 18, 29
.TransmitANSI "akhimki"
.TransmitTerminalKey rcIBMTabKey
' Provide Password for Security
Dim hostpassword As String
hostpassword = ""
hostpassword = .GetPassword("PASSWORD:", "", "", "")
.TransmitANSI hostpassword
.TransmitANSI "50.7.13"
.TransmitTerminalKey rcIBMEnterKey
 
LR = excelApp.ActiveSheet.Range("B65536").End(xlUp).Row 'FInd the last row
 
For x = 2 to LR 'create a loop then the data from the cells is copied and pasted below.
 
z = excelApp.ActiveSheet.Range("B" & x).Copy
 
.WaitForEvent rcEnterPos, "30", "0", 4, 16
.WaitForDisplayString "CITY/SITE:", "30", 4, 4
.TransmitTerminalKey rcIBMTabKey
.TransmitTerminalKey rcIBMTabKey
.Paste
TransmitTerminalKey rcIBMTabKey
.WaitForEvent rcEnterPos, "30", "0", 23, 15
.WaitForDisplayString "SCREEN:", "30", 23, 7
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 1, 80
.WaitForDisplayString "UPDATE(Y/N):", "30", 1, 67
.MoveCursor 4, 11 
 
z = excelApp.ActiveSheet.Range("C" & x).Copy
 
.WaitForEvent rcEnterPos, "30", "0", 4, 11
.WaitForDisplayString "SEALS..:", "30", 4, 2
.Paste
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
 
Next x
 
End With
 
End Sub
<CODE><CODE>
</CODE></CODE>
 
Upvote 0
well bro the code executed but stopped at :((((
LR = excelApp.ActiveSheet.Range("B65536").End(xlUp).Row 'FInd the last row

showing error Run-time error '1004'
application defined or object defined error
 
Upvote 0
So it is having an issue with finding the last row on your worksheet....Change the "YourSheet" to whatever the sheet is...

Code:
Sub macro_22333()
Dim WbSource as Workbook
Dim z As Integer
Dim LR as Integer
 
Set excelApp = GetObject("C:\Documents and Settings\mintezar\Desktop\Book1.xlsx")
 
With Session
 
.WaitForEvent rcEnterPos, "30", "0", 1, 1
.TransmitTerminalKey rcIBMPf9Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 5, 13
.WaitForDisplayString "==>", "30", 5, 9
.TransmitANSI "1"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 18, 33
.WaitForDisplayString "ID:", "30", 18, 29
.TransmitANSI "akhimki"
.TransmitTerminalKey rcIBMTabKey
' Provide Password for Security
Dim hostpassword As String
hostpassword = ""
hostpassword = .GetPassword("PASSWORD:", "", "", "")
.TransmitANSI hostpassword
.TransmitANSI "50.7.13"
.TransmitTerminalKey rcIBMEnterKey
 
LR = Workbooks(WbSource).WorkSheet("yoursheet").Range("B65536").End(xlUp).Row 'FInd the last row
 
For x = 2 to LR 'create a loop then the data from the cells is copied and pasted below.
 
z = Workbooks(WbSource).WorkSheet("yoursheet").Range("B" & x).Copy
 
.WaitForEvent rcEnterPos, "30", "0", 4, 16
.WaitForDisplayString "CITY/SITE:", "30", 4, 4
.TransmitTerminalKey rcIBMTabKey
.TransmitTerminalKey rcIBMTabKey
.Paste
TransmitTerminalKey rcIBMTabKey
.WaitForEvent rcEnterPos, "30", "0", 23, 15
.WaitForDisplayString "SCREEN:", "30", 23, 7
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 1, 80
.WaitForDisplayString "UPDATE(Y/N):", "30", 1, 67
.MoveCursor 4, 11 
 
z = Workbooks(WbSource).WorkSheet("yoursheet")..Range("C" & x).Copy
 
.WaitForEvent rcEnterPos, "30", "0", 4, 11
.WaitForDisplayString "SEALS..:", "30", 4, 2
.Paste
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
 
Next x
 
End With
 
End Sub
 
Upvote 0
for eg :

LR = Workbooks(WbSource).WorkSheet("yoursheet").Range("B65536").End(xlUp).Row 'FInd the last row
replace yoursheet with the active Sheet name rite ! like this >>
LR = Workbooks(WbSource).WorkSheet("SealList").Range("B65536").End(xlUp).Row 'FInd the last

</pre>
 
Upvote 0
1st it was executing till

.TransmitANSI "50.7.13" & was not able to find the Row to start from
but Know it is showing error in start at
Dim WbSource as Workbook ( user defined type not defined)


</pre>
 
Upvote 0
did it now its shown another error at
LR = Workbooks(WbSource).WorkSheet("yoursheet").Range("B65536").End(xlUp).Row 'FInd the last row
by highlighting Workbooks
Sub or Function not Defined
 
Upvote 0

Forum statistics

Threads
1,223,708
Messages
6,174,006
Members
452,542
Latest member
Bricklin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top