bardecode.com
barcode reading software
  • Home
  • Download
  • Purchase
  • SDK Licensing
  • Pricing
    • Windows SDK Price List
    • Windows SDK with PDF Extension Price List
    • Linux SDK Price List
    • Linux SDK with PDF Extension Price List
    • PDF Extension For Windows Price List
    • Multi-Platform Toolkit for .NET Price List
    • BardecodeFiler Desktop Only Price List
    • BardecodeFiler Windows Service Price List
    • DOS Command Prompt Barcode Tool Price List
    • Terms and Conditions
    • Refund Policy
  • Products
    • Softek Barcode Reader Toolkit for Windows
    • Softek Barcode Reader Toolkit for Linux
    • BardecodeFiler Desktop App
    • BardecodeFiler Windows Service
    • Windows DOS Command Prompt Tool
    • Multi-platform barcode reader toolkit for .NET
    • Aquaforest’s Autobahn DX
  • Knowledge Base
    • Documentation
    • Specifications
  • News
  • Contact
    • About Us
    • Terms and Conditions
    • Resellers
    • Links
Select Page ...

News

Excel VBA Macro

admin November 27, 2012 Software Development Kits No Comments

Here’s some example code that you can use in an Excel VBA macro…

Before you begin, make sure you have downloaded and installed the barcode reader sdk for windows, and run REGISTER.BAT as administrator in the bin folder.

Set Barcode = CreateObject("SoftekBarcodeCOM.Barcode")
' Set the license key here
Barcode.LicenseKey = "MY LICENSE KEY"
Barcode.ScanDirection = 15
' Select the barcode type to search for
Barcode.ReadCode128 = True
Barcode.ReadCode25 = True
Barcode.ReadEAN13 = True
Barcode.ReadEAN8 = True
Barcode.ReadUPCA = True
Barcode.ReadUPCE = True
Barcode.ReadCode39 = True
FILE_NAME = "C:\PATH\TO\MY\IMAGE.TIF"
Barcode.ScanBarCode (FILE_NAME)
nBarCode = Barcode.BarCodeCount
If (nBarCode <= -6) Then
    'Evaluation expired or is not valid
    MsgBox ("License error")
ElseIf (nBarCode < 0) Then
    MsgBox ("Error reading barcode")
ElseIf (nBarCode = 0) Then
    MsgBox ("No barcode found")
Else
    strBarcode = Barcode.barstring(1)
End If

You’ll need to modify the FILE_NAME to some file on your system and do something withthe strBarcode result, but this should get you up and working.

← Reducing False Readings
How to Restore Default Settings in BardecodeFiler →
admin

  • Copyright © 2023 Softek Software Ltd. All Rights Reserved