| Public RowValueLong As Long |
| Public Total_Acct As Long |
| Public PTH As String |
| Sub FDR_INFO() |
| Dim oSys As Object |
| Dim oSess As Object |
| Dim oScreen As Object |
| PTH = Trim(Sheets("FILE PATH").Range("B5").Value) |
| Set oSys = GetObject(PTH) |
| If oSys Is Nothing Then |
| MsgBox ("There is no FDR attachment system in the specified location") |
| Exit Sub |
| End If |
| 'GET ACCESS TO THE CURRENTLY ACTIVE SESSION... |
| Set oSess = oSys.screen |
| If oSess Is Nothing Then |
| MsgBox ("No session available...stopping macro playback.") |
| Exit Sub |
| End If |
| Total_Acct = WorksheetFunction.CountA(Sheets("PROCESSING").Range("B:B")) |
| RowValueLong = InputBox("Enter the Row value") |
| While Trim(Sheets("PROCESSING").Cells(RowValueLong, 2).Value) <> "" |
| '********************************************************* |
| 'Get into the Bs Screen |
| '********************************************************* |
| oSess.putString "BS", 1, 2 |
| oSess.MoveTo 1, 5 |
| oSess.SendKeys "<EraseEOF>" |
| WaitStatus oSess.OIA |
| oSess.putString Trim((Sheets("PROCESSING").Cells(RowValueLong, 2).Value)), 1, 5 |
| oSess.MoveTo 1, 24 |
| WaitStatus oSess.OIA |
| oSess.SendKeys "<Enter>" |
| WaitStatus oSess.OIA |
| Sheets("PROCESSING").Cells(RowValueLong, 3).Value = Trim(oSess.GetString(4, 48, 1)) |
| WaitStatus oSess.OIA |
| Sheets("PROCESSING").Cells(RowValueLong, 4).Value = Trim(oSess.GetString(4, 50, 1)) |
| WaitStatus oSess.OIA |
| Sheets("PROCESSING").Cells(RowValueLong, 5).Value = Trim(oSess.GetString(5, 48, 4)) |
| '********************************************************* |
| 'Get into the Bs5 Screen |
| '********************************************************* |
| WaitStatus oSess.OIA |
| oSess.putString "BS5", 1, 2 |
| WaitStatus oSess.OIA |
| oSess.MoveTo 1, 5 |
| WaitStatus oSess.OIA |
| oSess.SendKeys "<Enter>" |
| WaitStatus oSess.OIA |
| CName = oSess.GetString(3, 11, 27) |
| WaitStatus oSess.OIA |
| On Error GoTo GET_LASTNAME: |
| Len_CName = Len(CName) |
| FND = WorksheetFunction.Find(",", CName, 1) |
| lname = Left(CName, FND - 1) |
| Sheets("PROCESSING").Cells(RowValueLong, 7).Value = lname |
| FName = Mid(CName, FND + 1, Len_CName - FND) |
| Sheets("PROCESSING").Cells(RowValueLong, 6).Value = FName |
| GoTo NextStp: |
| GET_LASTNAME: |
| Sheets("PROCESSING").Cells(RowValueLong, 6).Value = CName |
| NextStp: |
| WaitStatus oSess.OIA |
| Sheets("PROCESSING").Cells(RowValueLong, 8).Value = Trim(oSess.GetString(5, 11, 27)) |
| WaitStatus oSess.OIA |
| Sheets("PROCESSING").Cells(RowValueLong, 9).Value = Trim(oSess.GetString(6, 11, 27)) |
| WaitStatus oSess.OIA |
| Sheets("PROCESSING").Cells(RowValueLong, 10).Value = Trim(oSess.GetString(7, 6, 19)) |
| WaitStatus oSess.OIA |
| Sheets("PROCESSING").Cells(RowValueLong, 11).Value = Trim(oSess.GetString(7, 28, 2)) |
| WaitStatus oSess.OIA |
| Sheets("PROCESSING").Cells(RowValueLong, 12).Value = Trim(oSess.GetString(8, 5, 10)) |
| WaitStatus oSess.OIA |
| oSess.putString "BS", 1, 3 |
| WaitStatus oSess.OIA |
| oSess.MoveTo 1, 5 |
| WaitStatus oSess.OIA |
| oSess.SendKeys "<Enter>" |
| WaitStatus oSess.OIA |
| RowValueLong = RowValueLong + 1 |
| WaitStatus oSess.OIA |
| Wend |
| End Sub |
VBA Reference to be added: VBA - UI Automation Project sample code Dim MyElement As UIAutomationClient.IUIAutomationElement Dim MyElement1 As UIAutomationClient.IUIAutomationElement 'Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) Public Enum oConditions eUIA_NamePropertyId eUIA_AutomationIdPropertyId eUIA_ClassNamePropertyId eUIA_LocalizedControlTypePropertyId End Enum Sub Test() Dim AppObj As UIAutomationClient.IUIAutomationElement Dim oInvokePattern As UIAutomationClient.IUIAutomationInvokePattern Dim oAutomation As New CUIAutomation ' the UI Automation API\ Dim oPattern As UIAutomationClient.IUIAutomationLegacyIAccessiblePattern Set AppObj = WalkEnabledElements("BTB Portal 3.0 KA") Set MyElement = AppObj.FindFirst(TreeScope_Children, PropCon...
Comments
Post a Comment