ByteScout Barcode Reader SDK - Microsoft Excel - Read barcodes from folder - ByteScout

ByteScout Barcode Reader SDK – Microsoft Excel – Read barcodes from folder

  • Home
  • /
  • Articles
  • /
  • ByteScout Barcode Reader SDK – Microsoft Excel – Read barcodes from folder

How to read barcodes from folder in Microsoft Excel and ByteScout BarCode Reader SDK

How to write a robust code in Microsoft Excel to read barcodes from folder with this step-by-step tutorial

The sample source codes on this page shows how to read barcodes from folder in Microsoft Excel. ByteScout BarCode Reader SDK is the SDK for reading of barcodes from PDF, images and live camera or video. Almost every common type like Code 39, Code 128, GS1, UPC, QR Code, Datamatrix, PDF417 and many others are supported. Supports noisy and defective images and docs. Includes optional documents splitter and merger for pdf and tiff based on found barcodess. Batch mode is supported for superior performance using multiple threads. Decoded values are easily exported to JSON, CSV, XML and to custom format and you can use it to read barcodes from folder with Microsoft Excel.

The SDK samples given below describe how to quickly make your application do read barcodes from folder in Microsoft Excel with the help of ByteScout BarCode Reader SDK. This Microsoft Excel sample code is all you need for your app. Just copy and paste the code, add references (if needs to) and you are all set! Check Microsoft Excel sample code samples to see if they respond to your needs and requirements for the project.

Trial version of ByteScout BarCode Reader SDK is available for free. Source code samples are included to help you with your Microsoft Excel app.

On-demand (REST Web API) version:
 Web API (on-demand version)

On-premise offline SDK for Windows:
 60 Day Free Trial (on-premise)

BarcodeReaderCode_VB.txt
      
' IMPORTANT: This demo uses VBA so if you have it disabled please temporary enable ' by going to Tools - Macro - Security.. and changing the security mode to ""Medium"" ' to Ask if you want enable macro or not. Then close and reopen this Excel document ' You should have evaluation version of the ByteScout SDK installed to get it working - get it from https://bytescout.com ' If you are getting error message like ' "File or assembly named Bytescout SDK, or one of its dependencies, was not found" ' then please try the following: ' ' - Close Excel ' - (for Office 2003 only) download and install this hotfix from Microsoft: ' http://www.microsoft.com/downloads/details.aspx?FamilyId=1B0BFB35-C252-43CC-8A2A-6A64D6AC4670&displaylang=en ' ' and then try again! ' ' If you have any questions please contact us at http://bytescout.com/support/ or at support@bytescout.com '============================================== 'References used '================= 'Bytescout Barcode Reader SDK ' ' IMPORTANT: ' ============================================================== '1) Add the ActiveX reference in Tools -> References '2) Enter path of folder containing barcode files's value into text box '3) Get All files into that folder and iterage through it '4) Read all barcodes into each file and write all values into cells '================================================================== Option Explicit Sub Barcode_Click() 'Fetch the Worksheet Dim mySheet As Worksheet Set mySheet = Worksheets(1) 'Barcode_Data Sheet ' Set Initial Value mySheet.Range("A2").Value = "Barcode Value" mySheet.Range("B2").Value = "File Name" Dim InputFolder As String InputFolder = mySheet.OLEObjects("TextBox1").Object.Value ' Set cell index value Dim CellIndex As Integer CellIndex = 2 If InputFolder = "" Then MsgBox "Input Folder value is empty" Else Call ProcessFolder(InputFolder, mySheet, CellIndex) End If End Sub Sub ProcessFolder(ByVal folderPath As String, ByRef mySheet As Worksheet, ByRef CellIndex As Integer) Dim Reader As New Bytescout_BarCodeReader.Reader Set Reader = CreateObject("Bytescout.BarCodeReader.Reader") ' Set multiple barcode types for searching Reader.BarcodeTypesToFind.Code39 = True Reader.BarcodeTypesToFind.QRCode = True Reader.BarcodeTypesToFind.PDF417 = True Reader.BarcodeTypesToFind.EAN13 = True ' define allowed input images extensions Dim inputImagesExtensions As String inputImagesExtensions = "JPG,JPEG,PNG,BMP,PDF,TIF" Dim objFSO Set objFSO = CreateObject("Scripting.FileSystemObject") Dim objFolder Set objFolder = objFSO.GetFolder(folderPath) Dim colFiles Set colFiles = objFolder.Files If colFiles.Count = 0 Then MsgBox "Entered Folder contains no files" Else Dim objFile For Each objFile In colFiles ' Check the file type If InStr(inputImagesExtensions, UCase(objFSO.GetExtensionName(objFile.Name))) > 0 Then Reader.ReadFromFile objFile.Path Dim i For i = 0 To Reader.FoundCount - 1 ' Get cell value CellIndex = (CellIndex + 1) mySheet.Range("A" + CStr(CellIndex)).Value = Reader.GetFoundBarcodeValue(i) mySheet.Range("B" + CStr(CellIndex)).Value = objFile.Name Next End If Next Dim subFolder For Each subFolder In objFolder.SubFolders ProcessFolder subFolder, mySheet, CellIndex Next End If End Sub

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout BarCode Reader SDK Home Page

Explore ByteScout BarCode Reader SDK Documentation

Explore Samples

Sign Up for ByteScout BarCode Reader SDK Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Reference Error – README.txt
      
' IMPORTANT: This demo uses VBA so if you have it disabled please temporary enable ' by going to Tools - Macro - Security.. and changing the security mode to ""Medium"" ' to Ask if you want enable macro or not. Then close and reopen this Excel document ' You should have evaluation version of the ByteScout SDK installed to get it working - get it from https://bytescout.com ' If you are getting error message like ' "File or assembly named Bytescout SDK, or one of its dependencies, was not found" ' then please try the following: ' ' - Close Excel ' - (for Office 2003 only) download and install this hotfix from Microsoft: ' http://www.microsoft.com/downloads/details.aspx?FamilyId=1B0BFB35-C252-43CC-8A2A-6A64D6AC4670&displaylang=en ' ' and then try again! ' ' If you have any questions please contact us at http://bytescout.com/support/ or at support@bytescout.com

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout BarCode Reader SDK Home Page

Explore ByteScout BarCode Reader SDK Documentation

Explore Samples

Sign Up for ByteScout BarCode Reader SDK Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

VIDEO

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout BarCode Reader SDK Home Page

Explore ByteScout BarCode Reader SDK Documentation

Explore Samples

Sign Up for ByteScout BarCode Reader SDK Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next