Comment on Tutorial - How to export from DataGridView to excel using 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 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
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. Good job. Very clear and concise and a great help.
View Tutorial          By: Eduardo at 2012-02-08 19:18:50

2. This was the first clear and straight-forward exam
View Tutorial          By: Steve at 2013-01-02 22:58:32

3. Hi i changed some codes in that and i gave interne
View Tutorial          By: Göktuğ ÖZEL at 2013-03-13 22:44:55

4. sir, thanks sir. very help to me. its simple and e
View Tutorial          By: kannathasan.M at 2012-10-01 07:59:28

5. very helpful & gud tutorial...

View Tutorial          By: Narpinder Sharma at 2011-06-27 03:12:20

6. Hi.

Mi question is more simple. I w

View Tutorial          By: David at 2010-10-03 04:59:09

7. hi....!
This program is working well in co

View Tutorial          By: param at 2014-10-15 07:02:49

8. crystal clear explanation. He's explained very nic
View Tutorial          By: jay at 2009-12-08 10:28:14

9. im having problems with showDialog(int) who can i
View Tutorial          By: Samuel at 2013-06-30 05:13:38

10. Good One..
View Tutorial          By: Subhranil Mukherjee at 2015-03-11 07:22:18