NYANBCNY32
asked on
How to search inside Attachmate EXTRA! VB Excel Macro
I'm trying to code a macro in Excel VB that will search an Attachmate Extra! Session and scrape data from the screen into Excel. This is what I've coded so far but not sure if the spaces are causing an issue. The problem is that it's only matching by the word "Type" and I need it to be an exact match as there are several TYPE that are listed on the screen.
Is there something I'm missing to put into this so that it will only match the search string criteria? Any help would be greatly appreciated. Thank you.
SearchString = ("TYPE 00")
Set MyArea = Sess0.Screen.Search(Search String)
If MyArea.Top <> SearchString Then
Sess0.Screen.SendKeys "<Enter>"
ElseIf MyArea.Top = SearchString Then
Sess0.Screen.Row = MyArea.Top
Sess0.Screen.Col = MyArea.Right+1
X = Sess0.Screen.Row
Y = Sess0.Screen.Col
i = 6
DATA= Format$(Format$(Sess0.Scre en.GetStri ng(X, Y, i), "##/##/##"), "mm/dd/yy")
Let ActiveCell.Offset(0, 0).Range("F1") = DATA
End If
Is there something I'm missing to put into this so that it will only match the search string criteria? Any help would be greatly appreciated. Thank you.
SearchString = ("TYPE 00")
Set MyArea = Sess0.Screen.Search(Search
If MyArea.Top <> SearchString Then
Sess0.Screen.SendKeys "<Enter>"
ElseIf MyArea.Top = SearchString Then
Sess0.Screen.Row = MyArea.Top
Sess0.Screen.Col = MyArea.Right+1
X = Sess0.Screen.Row
Y = Sess0.Screen.Col
i = 6
DATA= Format$(Format$(Sess0.Scre
Let ActiveCell.Offset(0, 0).Range("F1") = DATA
End If
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I was able to figure out the issue and upon implementing it into the macro language it processed correctly.
Try changing SearchString to strSearch
Open in new window