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. thank u its a clear information .i got the solutio
View Tutorial          By: anand at 2011-06-29 09:30:12

2. Thank you lot of..@
This example help me.

View Tutorial          By: Tushar at 2012-02-12 02:48:10

3. HI guys i am also studying c++ And now almost mast
View Tutorial          By: Inayat Ullah at 2011-02-08 09:29:44

4. Thanks ... nice one with clear picture.
View Tutorial          By: Nithin at 2012-04-01 06:58:41

5. Abstract class is a class that can not be instanti
View Tutorial          By: Abstract at 2011-07-19 01:14:09

6. pretty simply explained
View Tutorial          By: nivedita at 2011-06-09 07:32:58

7. wats the output ?
View Tutorial          By: siri at 2011-10-25 08:20:10

8. Fantastic Post, can u pls tell me how can i pass q
View Tutorial          By: Kunal at 2012-08-07 07:02:41

9. Thanks.... Nice Example
View Tutorial          By: Nagarjuna at 2012-05-29 12:00:50

10. my code is unable to open included files
ho

View Tutorial          By: MANAS at 2013-09-08 05:44:46