Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
' Untested
Declare Sub Wait(Sess As Object)
Sub Main()
Dim Sys As Object, Sess As Object
Set Sys = CreateObject("Extra.System")
If Sys Is Nothing Then
MsgBox ("Could not create Extra.System...is E!PC installed on this machine?")
Exit Sub
End If
Set Sess = Sys.ActiveSession
If Sess Is Nothing Then
MsgBox ("No session available...stopping macro playback.")
Exit Sub
End If
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim xl As Object, xl_wb As Object, xl_sheet_1 As Object, xl_sheet_2 As Object, file_name As String
Dim curr_id As String, journal_id As String, key As String, key_mask As String
Dim tl As String, trans_list As String, opt_access As String, update As String
Dim delete As String, opt_insert As String, replace As String, move As String, overlay As String
Dim i As Integer, next_row As Integer
[COLOR=red]file_name = "C:\Excel.xls"[/color]
Set xl = CreateObject("Excel.Application")
Set xl_wb = xl.Workbooks.Open(file_name)
Set xl_sheet_1 = xl_wb.Sheets("Sheet1")
Set xl_sheet_2 = xl_wb.Sheets("Sheet2")
xl.Visible = True
xl.DisplayAlerts = False
xl_sheet_2.Range("1:1").EntireRow.Font.Size = 12
xl_sheet_2.Cells(1, 1) = "JOURNAL ID"
xl_sheet_2.Cells(1, 2) = "KEY"
xl_sheet_2.Cells(1, 3) = "KEY MASK"
xl_sheet_2.Cells(1, 4) = "TL"
xl_sheet_2.Cells(1, 5) = "TRANSLIST"
xl_sheet_2.Cells(1, 6) = "ACCESS/DISP"
xl_sheet_2.Cells(1, 7) = "UPDATE"
xl_sheet_2.Cells(1, 8) = "INSERT"
xl_sheet_2.Cells(1, 9) = "REPLACE"
xl_sheet_2.Cells(1, 10) = "DELETE"
xl_sheet_2.Cells(1, 11) = "MOVE"
xl_sheet_2.Cells(1, 12) = "OVERLAY"
next_row = xl_sheet_2.UsedRange.Rows.Count + 1
'Do
journal_id = Trim(Sess.Screen.GetString(5, 58, 12))
key = Trim(Sess.Screen.GetString(8, 80, 1))
key_mask = Trim(Sess.Screen.GetString(9, 3, 100)) + Trim(Sess.Screen.GetString(10, 3, 100))
tl = Trim(Sess.Screen.GetString(13, 16, 100))
trans_list = Trim(Sess.Screen.GetString(13, 80, 1))
opt_access = Trim(Sess.Screen.GetString(18, 10, 1))
update = Trim(Sess.Screen.GetString(18, 20, 1))
opt_insert = Trim(Sess.Screen.GetString(18, 30, 1))
replace = Trim(Sess.Screen.GetString(18, 40, 1))
delete = Trim(Sess.Screen.GetString(18, 50, 1))
move = Trim(Sess.Screen.GetString(18, 60, 1))
overlay = Trim(Sess.Screen.GetString(18, 71, 1))
For i = 2 To 109
curr_id = Trim(xl_sheet_1.Cells(i, "B").Value)
If curr_id <> "" Then
[COLOR=red]' Not sure if this is what you want
If UCase(journal_id) = UCase(curr_id) Then[/color]
xl_sheet_2.Cells(next_row, "A").Value = journal_id
xl_sheet_2.Cells(next_row, "B").Value = key
xl_sheet_2.Cells(next_row, "C").Value = key_mask
xl_sheet_2.Cells(next_row, "D").Value = tl
xl_sheet_2.Cells(next_row, "E").Value = trans_list
xl_sheet_2.Cells(next_row, "F").Value = opt_access
xl_sheet_2.Cells(next_row, "G").Value = update
xl_sheet_2.Cells(next_row, "H").Value = opt_insert
xl_sheet_2.Cells(next_row, "I").Value = replace
xl_sheet_2.Cells(next_row, "J").Value = delete
xl_sheet_2.Cells(next_row, "K").Value = move
xl_sheet_2.Cells(next_row, "L").Value = overlay
next_row = next_row + 1
Exit For
End If
End If
Next
' Sess.Screen.SendKeys ("<PF8>") 'next screen
' Call Wait(Sess)
'[COLOR=red]Loop While UCase(Sess.Screen.GetString(24, 1, 9)) <> "LAST PAGE"[/color]
xl_sheet_2.Range("1:12").EntireColumn.AutoFit
xl_wb.Save
xl_wb.Close
xl.Quit
Set xl_sheet_2 = Nothing
Set xl_sheet_1 = Nothing
Set xl_wb = Nothing
Set xl = Nothing
Set Sess = Nothing
Set Sys = Nothing
End Sub
Sub Wait(Sess As Object)
Do While Sess.Screen.OIA.Xstatus <> 0
DoEvents
Loop
End Sub
---------- -------- -----------------------
Screen Sheet1 Sheet2
journal_id Column B Columns A-L
---------- -------- -----------------------
AAA 123 "AAA", key, key_mask...
ABC
XYC
Compare what with Sheet 1, column G? The journal_id from the screen?WHAT I NEED IT I COMPARE WITH G AND WRITE IN SHEET2
'Untested
Declare Sub Wait(Sess As Object)
Sub Main()
Dim Sys As Object, Sess As Object
Set Sys = CreateObject("Extra.System")
If Sys Is Nothing Then
MsgBox ("Could not create Extra.System...is E!PC installed on this machine?")
Exit Sub
End If
Set Sess = Sys.ActiveSession
If Sess Is Nothing Then
MsgBox ("No session available...stopping macro playback.")
Exit Sub
End If
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim dict As Object
Dim xl As Object, xl_wb As Object, xl_sheet_1 As Object, xl_sheet_2 As Object, file_name As String
Dim curr_id As String, journal_id As String, key As String, key_mask As String
Dim tl As String, trans_list As String, opt_access As String, update As String
Dim delete As String, opt_insert As String, replace As String, move As String, overlay As String
Dim i As Integer, next_row As Integer, last_row As Integer
[COLOR=red]file_name = "C:\Excel.xls"[/color]
Set dict = CreateObject("Scripting.Dictionary")
Set xl = CreateObject("Excel.Application")
Set xl_wb = xl.Workbooks.Open(file_name)
Set xl_sheet_1 = xl_wb.Sheets("Sheet1")
Set xl_sheet_2 = xl_wb.Sheets("Sheet2")
xl.Visible = True
xl.DisplayAlerts = False
xl_sheet_2.Range("1:1").EntireRow.Font.Size = 12
xl_sheet_2.Cells(1, 1) = "JOURNAL ID"
xl_sheet_2.Cells(1, 2) = "KEY"
xl_sheet_2.Cells(1, 3) = "KEY MASK"
xl_sheet_2.Cells(1, 4) = "TL"
xl_sheet_2.Cells(1, 5) = "TRANSLIST"
xl_sheet_2.Cells(1, 6) = "ACCESS/DISP"
xl_sheet_2.Cells(1, 7) = "UPDATE"
xl_sheet_2.Cells(1, 8) = "INSERT"
xl_sheet_2.Cells(1, 9) = "REPLACE"
xl_sheet_2.Cells(1, 10) = "DELETE"
xl_sheet_2.Cells(1, 11) = "MOVE"
xl_sheet_2.Cells(1, 12) = "OVERLAY"
last_row = xl_sheet_1.Range("B1").CurrentRegion.Rows.Count
next_row = xl_sheet_2.Range("A1").CurrentRegion.Rows.Count + 1
For i = 2 To last_row
curr_id = Trim(xl_sheet_1.Cells(i, "B").Value)
If curr_id <> "" And Not dict.Exists(curr_id) Then
dict.item(curr_id) = curr_id
End If
Next
[COLOR=red]'Do[/color]
journal_id = Trim(Sess.Screen.GetString(5, 58, 12))
key = Trim(Sess.Screen.GetString(8, 80, 1))
key_mask = Trim(Sess.Screen.GetString(9, 3, 100)) + Trim(Sess.Screen.GetString(10, 3, 100))
tl = Trim(Sess.Screen.GetString(13, 16, 100))
trans_list = Trim(Sess.Screen.GetString(13, 80, 1))
opt_access = Trim(Sess.Screen.GetString(18, 10, 1))
update = Trim(Sess.Screen.GetString(18, 20, 1))
opt_insert = Trim(Sess.Screen.GetString(18, 30, 1))
replace = Trim(Sess.Screen.GetString(18, 40, 1))
delete = Trim(Sess.Screen.GetString(18, 50, 1))
move = Trim(Sess.Screen.GetString(18, 60, 1))
overlay = Trim(Sess.Screen.GetString(18, 71, 1))
If Not dict.Exists(journal_id) Then
xl_sheet_2.Cells(next_row, "A").Value = journal_id
xl_sheet_2.Cells(next_row, "B").Value = key
xl_sheet_2.Cells(next_row, "C").Value = key_mask
xl_sheet_2.Cells(next_row, "D").Value = tl
xl_sheet_2.Cells(next_row, "E").Value = trans_list
xl_sheet_2.Cells(next_row, "F").Value = opt_access
xl_sheet_2.Cells(next_row, "G").Value = update
xl_sheet_2.Cells(next_row, "H").Value = opt_insert
xl_sheet_2.Cells(next_row, "I").Value = replace
xl_sheet_2.Cells(next_row, "J").Value = delete
xl_sheet_2.Cells(next_row, "K").Value = move
xl_sheet_2.Cells(next_row, "L").Value = overlay
dict.item(journal_id) = journal_id
xl_sheet_1.Cells(last_row + 1, "B").Value = journal_id
last_row = xl_sheet_1.Range("B1").CurrentRegion.Rows.Count
next_row = next_row + 1
End If
[COLOR=red]
' Sess.Screen.SendKeys ("<PF8>") 'next screen
' Call Wait(Sess)
'Loop While UCase(Sess.Screen.GetString(24, 1, 9)) <> "LAST PAGE"[/color]
xl_sheet_2.Range("1:12").EntireColumn.AutoFit
xl_wb.Save
xl_wb.Close
xl.Quit
Set xl_sheet_2 = Nothing
Set xl_sheet_1 = Nothing
Set xl_wb = Nothing
Set xl = Nothing
Set Sess = Nothing
Set Sys = Nothing
End Sub
Sub Wait(Sess As Object)
Do While Sess.Screen.OIA.Xstatus <> 0
DoEvents
Loop
End Sub
file_name = "C:\Excel.xls"
file_name = "C:\Documents and Settings\Desktop\Excel.xls" ' You
file_name = "C:\Documents and Settings\[COLOR=red]WinblowsME[/color]\Desktop\Excel.xls" ' Me
field_value = GetField ( "ABC,DEF,GHI", 1, "," ) ' Pulls field 1
MsgBox field_value
field_value = GetField ( "ABC,DEF,GHI", 2, "," ) ' Pulls field 2
MsgBox field_value