Comment on Tutorial - How to export from DataGridView to excel using VB.net By Issac



Comment Added by : Zarno

Comment Added at : 2010-12-24 07:11:19

Comment on Tutorial : How to export from DataGridView to excel using VB.net By Issac
Dim xlApp As Excel.Application
Dim xlWorkBook As Excel.Workbook
Dim xlWorkSheet As Excel.Worksheet
Dim misValue As Object = System.Reflection.Missing.Value
xlApp = New Excel.ApplicationClass
xlWorkBook = xlApp.Workbooks.Add(misValue)
xlWorkSheet = xlWorkBook.Sheets("Feuil1")

For Each col As DataGridViewColumn In DG_ENCOURS.Columns
'noms des colonnes
xlWorkSheet.Cells(1, col.Index + 1) = col.HeaderText
For Each rowa As DataGridViewRow In DG_ENCOURS.Rows
xlWorkSheet.Cells(rowa.Index + 2, col.Index + 1) = rowa.Cells(col.Index).Value
Next
Next
xlApp.Visible = True


View Tutorial



Subscribe to Tutorials

Related Tutorials

Program using concept of byte long short and int in java

Update contents of a file within a jar file

Tomcat and httpd configured in port 8080 and 80

Java File

Java String

Count number of vowels, consonants and digits in a String in Java

Reverse a number in Java

Student marks calculation program in Java

Handling Fractions in Java

Calculate gross salary in Java

Calculate average sale of the week in Java

Vector in Java - Sample Program

MultiLevel Inheritance sample in Java

Multiple Inheritance sample in Java

Java program using Method Overriding

Archived Comments

1. please explain thread t=new thread(this,name). Wha
View Tutorial          By: Bhavin at 2012-09-28 12:26:55

2. thanks for the definition...more power :)
View Tutorial          By: saluki at 2011-07-19 05:36:00

3. I want to using swith with string...
How to

View Tutorial          By: anuj at 2015-03-04 18:22:29

4. Hi
Gr8 work......!!!!
thanks...!!!

View Tutorial          By: Antim Jain at 2010-07-12 23:44:14

5. XML Parsing - Simplified.
Thanks.

View Tutorial          By: Piyush at 2011-05-19 22:56:23

6. it is very very use full to us
View Tutorial          By: santhosh at 2008-12-07 14:46:13

7. abstract class Explain the concept of abstract c
View Tutorial          By: rahul at 2012-02-23 08:30:47

8. the above is perfect, but when i hit the export bu
View Tutorial          By: CH at 2009-06-02 03:01:34

9. Nice Blog
View Tutorial          By: RAKESH KUMAR at 2015-08-04 10:07:50

10. article is good but I would have liked to get more
View Tutorial          By: Bharat Agrawal at 2010-09-25 22:18:40