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. Class TypeCasting
{
public static v

View Tutorial          By: kishoree koli at 2013-03-14 03:00:31

2. i get error like this :
The requested resou

View Tutorial          By: Vera Yunita at 2013-05-20 03:57:18

3. Very easy and simple to understand....good article
View Tutorial          By: Ashish at 2009-10-07 00:58:08

4. the exampe was really useful........
View Tutorial          By: smitha at 2011-03-10 21:27:55

5. This is the best example for beginners. After read
View Tutorial          By: BB at 2014-05-20 05:24:09

6. sir very well subject is to continuted the java s
View Tutorial          By: G.venkata siva naga kumar at 2009-11-06 01:13:02

7. hello sir , i m student of mca . i am working on S
View Tutorial          By: Pallavi at 2013-04-06 13:53:54

8. excellent
View Tutorial          By: shamim at 2011-07-08 02:39:31

9. its really helpfull to understand.
View Tutorial          By: rakhi at 2010-08-08 12:45:05

10. The code is running successfully.........but , I m
View Tutorial          By: Harshita at 2013-03-26 19:25:58