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. Hi , instead of using localhost. I am using a mobi
View Tutorial          By: vimal at 2010-12-02 01:44:40

2. we can create reference variable for an abstract c
View Tutorial          By: siva at 2012-08-30 06:03:50

3. Thanks.It helps a lot to me.
View Tutorial          By: Sachin at 2013-05-24 19:36:36

4. javax.comm.NoSuchPortException
at javax.com

View Tutorial          By: Augustin at 2013-04-27 11:12:47

5. i want full material of java with ds
with

View Tutorial          By: madhulatha at 2009-02-01 16:49:22

6. Hi, i am new java, and i want to become gud develo
View Tutorial          By: amit at 2012-02-16 12:21:25

7. i understand but i want many information and prog
View Tutorial          By: malathi at 2013-03-29 23:52:28

8. hi
Can you anyone please post me the entir

View Tutorial          By: yasmeen at 2009-05-25 02:42:44

9. very nice keep sharing thanks a lot
View Tutorial          By: Adeel at 2014-09-24 09:50:00

10. I have maked all you said and when I open jsp I am
View Tutorial          By: John at 2013-01-10 14:21:30