Thursday, December 20, 2012

Export data to Excel in Vb.Net with Auto format technique.

Data can be exported to an excel sheet in Vb.Net using Microsoft.Office.Interop.Excel namespace. Though it’s a classic example, exporting data into an excel file can be useful when you want to share your data in a well formatted way. Ms-Excel 2003 had an in built feature which allowed users to “Auto format” the entire sheet with ease. This feature is still available in the .Net framework for developers to work with excel formatting.


The “Auto Format” function in the application will automatically format the sheet immediately after the entire data is export into the excel sheet.

Note: ExcelAutoFormat.xlRangeAutoFormatList3, comes with a variety of formats which you should try.

Before starting the designing of the application, we need to add a “COM” library from the reference window. In the .Net IDE, click “Project” from the top menu list and select “Add Reference…” In the “Add Reference” window, select “COM” tab and find “Microsoft Excel 12.0 Object Library” from the list. Select it and click OK.



http://www.encodedna.com/2012/12/export-data-to-excel.htm

2 comments:

  1. Arun

    This database is compatible with .NET, Silverlight, Windows Phone, Mono, Monodroid, and Monotouch:
    http://www.kellermansoftware.com/p-43-ninja-net-database-pro.aspx

    ReplyDelete