Click here to return to previous page.

DataMatrix.xls file holds the IMEI and WLAN ID data pairs for all of the 510 Sales Packs to be reworked.

E75.xls file contains the operator prompt for the IMEI scan and the script that will query the DataMatix.xls file for the associated WLAN ID based on the scanned IMEI.  Once the data is found in the DataMatrix.xls file it is exported to the BarTender Application for printing.

E75.xls VBA Script…….

Private Sub CommandButton1_Click()

    scan = InputBox("Scan IMEI", "Scan IMEI", "")

    IMEI = Left(scan, 15)

    Workbooks.Open ("c:\E75\datamatrix.xls")

    Workbooks("datamatrix.xls").Sheets(2).Activate

    Workbooks("datamatrix.xls").Sheets(2).Range("A2:B2").Select

    Selection.ClearContents

    Workbooks("datamatrix.xls").Sheets(1).Activate

    With Worksheets(1).Range("a:a")

        Set a = .Find(IMEI, LookIn:=xlValues)

        If Not a Is Nothing Then

            firstAddress = a.Address

            stlen = Len(firstAddress)

            lad = Right(firstAddress, stlen - 2)

            addr = firstAddress & ":$B" & lad

            Do

                Workbooks("datamatrix.xls").Sheets(1).Range(addr).Select

                Selection.Copy

                Sheets(2).Select

                Workbooks("datamatrix.xls").Sheets(2).Range("A2").Select

                ActiveSheet.Paste

                Set a = .FindNext(a)

            Loop While Not a Is Nothing And a.Address <> firstAddress

        End If

    End With

    Workbooks("datamatrix.xls").Close SaveChanges:=True

    RetVal = Shell("C:\Program Files\Seagull\BarTender\8.0\Bartend.exe /F=C:\E75\Giftbox.btw /P", 0)

    Application.Wait (Now + TimeValue("0:00:06"))

End Sub

Click here to return to previous page.