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(SearchString)
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.Screen.GetString(X, Y, i), "##/##/##"), "mm/dd/yy")
Let ActiveCell.Offset(0, 0).Range("F1") = DATA
End If
Our community of experts have been thoroughly vetted for their expertise and industry experience.