ByteScout Barcode Suite - VBScript - Read code 39 to excel with barcode reader sdk - 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 Suite – VBScript – Read code 39 to excel with barcode reader sdk

  • Home
  • /
  • Articles
  • /
  • ByteScout Barcode Suite – VBScript – Read code 39 to excel with barcode reader sdk

How to read code 39 to excel with barcode reader sdk in VBScript and ByteScout Barcode Suite

Continuous learning is a crucial part of computer science and this tutorial shows how to read code 39 to excel with barcode reader sdk in VBScript

The sample source codes on this page shows how to read code 39 to excel with barcode reader sdk in VBScript. What is ByteScout Barcode Suite? It is the set that includes three different SDK products to generate barcodes, read barcodes and read and write spreadsheets: Barcode SDK, Barcode Reader SDK and Spreadsheet SDK. It can help you to read code 39 to excel with barcode reader sdk in your VBScript application.

Want to quickly learn? This fast application programming interfaces of ByteScout Barcode Suite for VBScript plus the guidelines and the code below will help you quickly learn how to read code 39 to excel with barcode reader sdk. Just copy and paste the code into your VBScript application’s code and follow the instructions. This basic programming language sample code for VBScript will do the whole work for you to read code 39 to excel with barcode reader sdk.

You can download free trial version of ByteScout Barcode Suite from our website to see and try many others source code samples for VBScript.

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

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

Code39BarcodeToExcel.vbs
      
if WScript.Arguments.Count < 1 Then MsgBox "Run with the folder path as the argument" & vbCRLF & vbCRLF & "Code39BarcodeToExcel.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 Code39 barcode types for searching reader.BarcodeTypesToFind.Code39 = 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("Code39") ' 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 Suite Home Page

Explore ByteScout Barcode Suite Documentation

Explore Samples

Sign Up for ByteScout Barcode Suite 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 Code39BarcodeToExcel.vbs "InputFiles" pause

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Barcode Suite Home Page

Explore ByteScout Barcode Suite Documentation

Explore Samples

Sign Up for ByteScout Barcode Suite 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 Suite Home Page

Explore ByteScout Barcode Suite Documentation

Explore Samples

Sign Up for ByteScout Barcode Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next