ByteScout Barcode Suite - VBScript - Read qr code to excel with barcode reader sdk - ByteScout

ByteScout Barcode Suite – VBScript – Read qr code to excel with barcode reader sdk

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

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

How to write a robust code in VBScript to read qr code to excel with barcode reader sdk with this step-by-step tutorial

Quickly learn how to read qr code to excel with barcode reader sdk in VBScript with this sample source code. ByteScout Barcode Suite is the bundle that privides 3 SDK products to generate barcodes (Barcode SDK), read barcodes (Barcode Reaer SDK) and read and write spreadsheets (Spreadsheet SDK). It can read qr code to excel with barcode reader sdk in VBScript.

Want to save time? You will save a lot of time on writing and testing code as you may just take the VBScript code from ByteScout Barcode Suite for read qr code to excel with barcode reader sdk below and use it in your application. IF you want to implement the functionality, just copy and paste this code for VBScript below into your code editor with your app, compile and run your application. Enjoy writing a code with ready-to-use sample codes in VBScript.

If you want to try other source code samples then the free trial version of ByteScout Barcode Suite is available for download from our website. Just try other 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)

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