With this source code sample you may quickly learn how to create barcode from excel in VBScript. ByteScout Spreadsheet SDK is the SDK component for writing, reading, modifying and calculating Excel and CSV spreadsheets. Can calculate and reculculate formulas with Excel installed. You may import or export data to and from CSV, XML, JSON. Supports export to databases, arrays, streams. It can create barcode from excel in VBScript.
VBScript code samples for VBScript developers help to speed up coding of your application when using ByteScout Spreadsheet SDK. Just copy and paste the code into your VBScript application’s code and follow the instruction. This basic programming language sample code for VBScript will do the whole work for you to create barcode from excel.
Our website provides trial version of ByteScout Spreadsheet SDK for free. It also includes documentation and source code samples.
' This example demonstrates reading values from Excel file and generating PDF417 barcodes. ' Please install Bytescout BarCode Generator SDK before run this example: ' http://bytescout.com/products/developer/barcodesdk/bytescoutbarcodesdk.html '*** Prepare Spreadsheet object Set spreadsheet = CreateObject("Bytescout.Spreadsheet.Spreadsheet") spreadsheet.RegistrationName = "demo" spreadsheet.RegistrationKey = "demo" ' Load Excel document spreadsheet.LoadFromFile("test.xlsx") ' Take the first worksheet Set worksheet = spreadsheet.Worksheet(0) '*** Prepare Barcode object - requies to download BarCode SDK from ByteScout.com site Set barcode = CreateObject("Bytescout.BarCode.Barcode") barcode.RegistrationName = "demo" barcode.RegistrationKey = "demo" ' Set barcode type to PDF417 barcode.Symbology = 13 ' 13 means PDF417 barcode ' Set higher resoultion (300 is good for printing) barcode.ResolutionX = 300 barcode.ResolutionY = 300 ' Show barcode caption (remove these lines if you don't need it) barcode.DrawCaption = True barcode.DrawCaptionFor2DBarcodes = True ' Run through worksheet rows For i = 0 To worksheet.NotEmptyRowMax - 1 ' Get barcode value from first worksheet column barcode.Value = worksheet.Item(i, 0).ValueAsString ' Fit barcode into 40x15 mm rectangle barcode.FitInto_3 40, 15, 4 ' 4 means millimeter units ' Save barcode image to file barcode.SaveImage("barcode" & i & ".png") Next ' Release objects Set spreadsheet = Nothing Set barcode = Nothing