Click here to Skip to main content
15,671,597 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I found this code: How to export datagridview to excel using

I was wondering if someone could explain me this code:
Dim xlApp As Microsoft.Office.Interop.Excel.Application
Dim xlWorkBook As Microsoft.Office.Interop.Excel.Workbook
Dim xlWorkSheet As Microsoft.Office.Interop.Excel.Worksheet
Dim misValue As Object = System.Reflection.Missing.Value
Dim i As Integer
Dim j As Integer

xlApp = New Microsoft.Office.Interop.Excel.ApplicationClass
xlWorkBook = xlApp.Workbooks.Add(misValue)
xlWorkSheet = xlWorkBook.Sheets("sheet1")

What is this "System.Reflection.Missing.Value"? Is this the datagridview? Where was the DataGridView initialized?

Or if you have another way in exporting the datagridview that would be pretty helpful.

Updated 6-Jul-14 23:16pm

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900