Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
Password Reminder
Register
Register | FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #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

Reply With Quote
  #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")
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 08:22 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.