ByteScout Barcode Reader SDK - VBScript - Barcodes to Excel - ByteScout
Announcement
Our ByteScout SDK products are sunsetting as we focus on expanding new solutions.
Learn More Open modal
Close modal
Announcement Important Update
ByteScout SDK Sunsetting Notice
Our ByteScout SDK products are sunsetting as we focus on our new & improved solutions. Thank you for being part of our journey, and we look forward to supporting you in this next chapter!

ByteScout Barcode Reader SDK – VBScript – Barcodes to Excel

  • Home
  • /
  • Articles
  • /
  • ByteScout Barcode Reader SDK – VBScript – Barcodes to Excel

barcodes to excel in VBScript with ByteScout BarCode Reader SDK

barcodes to excel in VBScript

We’ve created and updating regularly our sample code library so you may quickly learn barcodes to excel and the step-by-step process in VBScript. Barcodes to excel in VBScript can be implemented with ByteScout BarCode Reader SDK. 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.

VBScript, code samples for VBScript, developers help to speed up the application development and writing a code when using ByteScout BarCode Reader SDK. VBScript sample code is all you need: copy and paste the code to your VBScript application’s code editor, add a reference to ByteScout BarCode Reader SDK (if you haven’t added yet) and you are ready to go! You can use these VBScript sample examples in one or many applications.

On our website you may get trial version of ByteScout BarCode Reader SDK for free. Source code samples are included to help you with your VBScript application.

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

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

MultipleTypeBarcodeToExcel.vbs
      
if WScript.Arguments.Count < 1 Then MsgBox "Run with the folder path as the argument" & vbCRLF & vbCRLF & "MultipleTypeBarcodeToExcel.vbs <InputFolder>" WScript.Quit 0 End If Set objFSO = CreateObject("Scripting.FileSystemObject") ' define allowed input images extensions inputImagesExtensions = "JPG,JPEG,PNG,BMP,PDF,TIF" 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 ' Set excel document Set document = CreateObject("Bytescout.Spreadsheet.Spreadsheet") ' Set document keys document.RegistrationName = "demo" document.RegistrationKey = "demo" ' Add new worksheet Set worksheet = document.Workbook.Worksheets.Add("BarCodes") ' Set cell index value Dim CellIndex CellIndex = 0 ' Set Initial Value CellIndex = (CellIndex + 1) Set cell_value = worksheet.Cell_2("A" + Cstr(CellIndex)) Set cell_filename = worksheet.Cell_2("B" + Cstr(CellIndex)) cell_value.Value = "Barcode Value" cell_filename.Value = "File Name" Set objInputFolder = objFSO.GetFolder(WScript.Arguments(0)) Call ProcessFolder(objInputFolder) ' delete output file if exists already Set fso = CreateObject("Scripting.FileSystemObject") If (fso.FileExists("output.xls")) Then fso.DeleteFile("output.xls") Set fso = nothing ' save document document.SaveAs "output.xls" WScript.Echo "successfully created 'output.xls' file!" ' close Spreadsheet Set document = Nothing WScript.Quit 0 Sub ProcessFolder(folder) Set objFolder = objFSO.GetFolder(folder.Path) Set colFiles = objFolder.Files For Each objFile in colFiles ' Check the file type If inStr(inputImagesExtensions, UCase(objFSO.GetExtensionName(objFile.Name))) > 0 Then reader.ReadFromFile objFile.Path For i = 0 To reader.FoundCount - 1 ' Get cell value CellIndex = (CellIndex + 1) Set cell_value = worksheet.Cell_2("A" + Cstr(CellIndex)) Set cell_filename = worksheet.Cell_2("B" + Cstr(CellIndex)) ' set cell value cell_value.Value = reader.GetFoundBarcodeValue(i) cell_filename.Value = objFile.Name ' Write to console WScript.Echo "Extracted barcode '" & reader.GetFoundBarcodeValue(i) & "' from '"& objFile.Name &"' file" Next End If Next For Each subFolder in folder.SubFolders ProcessFolder subFolder Next 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

run.bat
      
REM running from the command line cscript.exe MultipleTypeBarcodeToExcel.vbs "InputFiles" pause

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