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.
obj.Worksheets("Sheet1").Range("B2:B109").AdvancedFilter Action:=xlFilterCopy, CopyToRange:=obj.Worksheets("Sheet1").Range("G1"), Unique:=True
Const xlFilterCopy As Integer = 2
obj.Worksheets("Sheet1").Range("B2:B109").AdvancedFilter Action:=xlFilterCopy, CopyToRange:=obj.Worksheets("Sheet1").Range("G1"), Unique:=True
' 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
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Const xlFilterCopy As Integer = 2
Dim xl As Object, xl_wb As Object, xl_sheet As Object, file_name As String
Dim account As String, part_no As String, part_name As String, part_key As String
Dim i As Integer, j As Long
file_name = "C:\testRAM567.xls"
Set xl = CreateObject("Excel.Application")
Set xl_wb = xl.Workbooks.Open(file_name)
Set xl_sheet = xl_wb.Sheets("Sheet1")
xl.Visible = True
xl.DisplayAlerts = False
xl_sheet.Range("A:A").EntireRow.Font.Size = 12
xl_sheet.Columns("A").ColumnWidth = 13
xl_sheet.Columns("B").ColumnWidth = 16
xl_sheet.Columns("C").ColumnWidth = 27
xl_sheet.Columns("D").ColumnWidth = 17
xl_sheet.Cells(1, 1) = "ACCOUNTS"
xl_sheet.Cells(1, 2) = "PARTNUMBER"
xl_sheet.Cells(1, 3) = "PARTNAME"
xl_sheet.Cells(1, 4) = "PARTKEY"
j = 2
Do
For i = 6 To 23
account = Trim(Sess.Screen.GetString(i, 11, 5))
part_no = Trim(Sess.Screen.GetString(i, 22, 10))
part_name = Trim(Sess.Screen.GetString(i, 35, 20))
part_key = Trim(Sess.Screen.GetString(i, 59, 10))
If part_no <> "XXXXXXXX" Then
xl_sheet.Cells(j, "A").Value = account
xl_sheet.Cells(j, "B").Value = part_no
xl_sheet.Cells(j, "C").Value = part_name
xl_sheet.Cells(j, "D").Value = part_key
j = j + 1
Else
Exit For
End If
Next
Sess.Screen.SendKeys ("<PF8>")
Call Wait(Sess)
[COLOR=red]Loop While Ucase(Sess.Screen.GetString(24, 1, 9)) <> "LAST PAGE"[/color]
xl_sheet.Cells.Sort Key1:=xl_sheet.Range("D1"), Header:=1
xl_sheet.Range("B2:B109").AdvancedFilter Action:=xlFilterCopy, CopyToRange:=xl_sheet.Range("G1"), Unique:=True
xl_wb.Save
xl_wb.Close
xl.Quit
Set xl_sheet = 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