Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
| Search | Today's Posts | Mark Forums Read
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old March 28th, 2007, 07:14 AM
Registered User
 
Join Date: Dec 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Export data to MS Excel in VB.NET

Hi,
Please advise me how to export DATASET data or MS Access to Excel using Visual Basic.
Thanks,
David

  #2 (permalink)  
Old December 9th, 2013, 03:06 AM
Registered User
Points: 18, Level: 1
Points: 18, Level: 1 Points: 18, Level: 1 Points: 18, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2013
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: Export data to MS Excel in VB.NET

Hi, you can try this VB.NET Excel component, I use it for creating a very large excel report files, really fast and did not have any issues.
Here is how you can export a DataSet to an Excel file in VB.NET:
Code:
' Create new ExcelFile.
Dim workbook = New ExcelFile()

' Export all tables from DataSet to a new file.
For Each dataTable As DataTable In dataSet.Tables
    ' Add new worksheet to the file.
    Dim worksheet = workbook.Worksheets.Add(dataTable.TableName)

    ' Insert the data from DataTable to the worksheet starting at cell "A1".
    worksheet.InsertDataTable(dataTable,
        New InsertDataTableOptions("A1") With {.ColumnHeaders = True})
Next

' Save the file to XLS format.
workbook.Save("DataSet.xls")


Similar Threads
Thread Thread Starter Forum Replies Last Post
Export DataGrid To Excel in vb.net jayakumar.cj ASP.NET 1.0 and 1.1 Basics 3 September 1st, 2010 03:09 AM
Problem VB.NET 2005 - update data in Ms Access Netuser Pro Visual Basic 2005 0 August 1st, 2008 01:34 PM
Export Data Grid to Excel in VB.net Windows App alapativg VS.NET 2002/2003 0 September 2nd, 2006 02:28 AM
how to export data to ms word from asp.net webapp parveen_kumar24@rediffmai .NET Framework 2.0 2 August 12th, 2006 05:17 AM
Copying Multiple Rows in MS Excel 2K using VB .Net Azhar Akbari Excel VBA 2 January 27th, 2005 10:04 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.