We help IT Professionals succeed at work.
Get Started

How to search inside Attachmate EXTRA! VB Excel Macro

525 Views
Last Modified: 2017-04-05
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
Comment
Watch Question
This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE