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. what are the basic requirements to send sms from p
View Tutorial          By: kanagarajan at 2008-01-02 07:52:44

2. This tutorial is good for beginners. If you provid
View Tutorial          By: Sateesh Bobby at 2008-12-09 23:56:18

3. Thanks for the digital shell clock: very cool, and
View Tutorial          By: Lol loller at 2012-04-11 15:40:45

4. i want code please send me.

luckys

View Tutorial          By: sam at 2014-11-12 06:19:26

5. Very simple and easy to understand... Thank u...
View Tutorial          By: Anu Priya at 2013-07-22 09:00:19

6. Good
View Tutorial          By: PRANJAL at 2015-08-14 16:38:57

7. What if I wanted POST instead of GET?
View Tutorial          By: Otto at 2011-06-12 15:38:50

8. Dear !

Thanks for the article. Now

View Tutorial          By: Mubasher at 2013-05-04 11:37:52

9. Hi Jon,

It really depends on the ap

View Tutorial          By: Hong at 2009-05-04 20:40:28

10. Best example to explain Inheritance. thankyou for
View Tutorial          By: Suresh Lilhare at 2010-05-14 09:10:27