将DataGridView导出到Excel文件VB

将DataGridView导出到Excel文件VB

本文介绍了将DataGridView导出到Excel文件VB.NET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好b $ b

我发现此代码:



我想知道是否有人可以解释这段代码:

Hi
I found this code: How to export datagridview to excel using vb.net?

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")



什么是这个System.Reflection.Missing.Value?这是datagridview吗? DataGridView初始化在哪里?



或者如果你有另一种方式导出datagridview会非常有帮助。



谢谢。


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.

Thanks.

推荐答案


这篇关于将DataGridView导出到Excel文件VB.NET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-05 06:23