将DataGridView导出到Excel文件VB.NET [英] Export DataGridView to Excel File VB.NET

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

问题描述

您好b $ b

我发现此代码:如何使用vb.net将datagridview导出到excel?



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

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.

推荐答案

请参阅以下链接

如何在VB.NET中将数据导出到Excel [ ^ ]

Export-GridView-to -Excel-in-ASPNet-with-Formatting-using-C-and-VBNet.aspx [ ^ ]
see the following links
How to Export Data to Excel in VB.NET[^]
Export-GridView-to-Excel-in-ASPNet-with-Formatting-using-C-and-VBNet.aspx[^]


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

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆