Java Barcode Generator, .NET Barcode Generator for C#, ASP.NET, VB.NET
HOME PURCHASE SITEMAP COMPANY

Home > .NET Barcode > Barcode Generation Guide > Word Barcode Generation Guide in C#

Download .NET Barcode Generator Trial

How to Generate Barcodes in Excel using C#





Quick Navigate



1. Prerequisites
  • BarcodeLib.Barcode.ASP.NET.dll / BarcodeLib.Barcode.WinForms.dll
  • Microsoft .NET Framework 2.0 (or later)
  • Visual Studio .NET 2005 or above
  • Microsoft Office Excel 2007 or above


2. How to install .NET Barcode Generator?
For installation, you just need to add the barcode component dll to vs project reference for later use.
  1. Create your barcoding project in Microsoft Visual Studio
  2. Right click in "Solution Explorer" and select "Add Reference..."
  3. In the pop-up window, click "Browse" to add either "BarcodeLib.Barcode.WinForms.dll" or "BarcodeLib.Barcode.ASP.NET.dll" to reference


3. How to Generate Barcodes in Excel using C#
  1. Open your Visual Studio, and create a new Visual C# project "Excel Wordbook"
  2. Now drag a PictureBox from the Toolbox and drop it in the Excel document
  3. Double click picturebox for Visual Basic programming
  4. Copy the Visual Basic .NET sample code below to your project
  5. Run the project and a barcode is printed in the MS Excel spreadsheet
         private void pictureBox1_Click(object sender, EventArgs e)
         {
         BarcodeLib.Barcode.Linear barcode = new BarcodeLib.Barcode.Linear();

         barcode.Type = BarcodeType.CODE39;
         barcode.Data = "Code128";
         barcode.DPI = 72;
         barcode.UOM = BarcodeLib.Barcode.UnitOfMeasure.PIXEL;
         barcode.Rotate = RotateOrientation.BottomFacingDown;
         
         barcode.BarWidth = 2; 
         barcode.BarHeight = 80;
         barcode.AutoResize = false;

         barcode.LeftMargin = 5;
         barcode.RightMargin = 5;
         barcode.TopMargin = 5;
         barcode.BottomMargin = 5;

         Bitmap bmp = barcode.drawBarcode();
         this.pictureBox1.Image = bmp;



Other Related .NET Barcode Generator SDKs



   Copyright © 2013 BarcodeLib.com. Provides High Quality .NET Barcode, Barcode .NET, .NET Barcode Generator, Barcode Generation for .NET, C# Barcode, ASP.NET Barcode, VB.NET Barcode Components. All rights reserved.