Hello all,
I have information in Extra! that I need to extract. I created an Excel file to be able to manipulate the data which I will extract.
My problem is getting my macro to see more than one instance of the string I'm searching for, as it is probable there will be more than one on each page. With [blue]Sess0.Screen.Search[/blue], I cannot get it to find more than one.
I assume that I have to write the code so that the macro will search line by line to find the string? If so, can I add something at the beginning of my code to do a general search on the page for the string - if nothing is found, it changes pages - if the string is found, then it goes line by line?
I have included my code. Any suggestions?
Thanks for your help.
dvirgint
I have information in Extra! that I need to extract. I created an Excel file to be able to manipulate the data which I will extract.
My problem is getting my macro to see more than one instance of the string I'm searching for, as it is probable there will be more than one on each page. With [blue]Sess0.Screen.Search[/blue], I cannot get it to find more than one.
I assume that I have to write the code so that the macro will search line by line to find the string? If so, can I add something at the beginning of my code to do a general search on the page for the string - if nothing is found, it changes pages - if the string is found, then it goes line by line?
I have included my code. Any suggestions?
Code:
Dim System As Object, Sess0 As Object, MyScreen As Object
Set System = CreateObject("EXTRA.System")
Set Sess0 = System.ActiveSession
Set MyScreen = Sess0.Screen
Dim i As Integer
Set tot_pages = MyScreen.area(1, 66, 1, 68)
ex_line = 2
Do
Set rad_find = Sess0.Screen.Search("String needed")
If rad_find <> "String needed" Then
Sess0.Screen.SendKeys ("<pf8>")
Else
rad_tax_year = Sess0.Screen.GetString(rad_find.Bottom, rad_find.Right - 17, 4)
Sheets("Chiffres").Cells(ex_line, "a") = rad_tax_year
If i = 12 Then
Exit Do
End If
End If
i = i + 1
Loop Until i = tot_pages
Thanks for your help.
dvirgint