Solved

fille Excel with Datatable

Posted on 2013-11-11
2
312 Views
Last Modified: 2013-11-25
Is there a way to fill Excel with datatable in vb.net and save it as a file?
0
Comment
Question by:VBdotnet2005
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 30

Accepted Solution

by:
anarki_jimbel earned 250 total points
ID: 39640574
There are examples and tutorial on Internet. You may find one on the MSDN web site:

http://code.msdn.microsoft.com/office/Export-DataTable-object-to-b3e2c1f0

The link is about importing dataset into Excel using VB.Net.
0
 
LVL 20

Assisted Solution

by:ElrondCT
ElrondCT earned 250 total points
ID: 39640711
The method shown in the article anarki_jimbel links to will work, but it's painfully slow. If your output has more than a few thousand cells, the overhead of doing each cell individually will kill you. You're much better off loading an array with the values from the DataTable, then loading the entire array into Excel using a command like
Dim oRange As Excel.Range = excelWorkSheet.Range("A1")
oRange.Value = oData

Open in new window

where excelWorkSheet is an individual sheet in a receiving Excel workbook (file) and oData is a two-dimensional array of values, which you would completely load before executing these lines.
0

Featured Post

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question