将DataGridView数据导出到MS Excel中时需要使用System.Reflection.Missing.Value的原因是什么,如下面的代码所示?
Dim missValue As Object = Reflection.Missing.Value
Dim xlApp As New Excel.Application
Dim xlWorkBook As Excel.Workbook = xlApp.Workbooks.Add(missValue)
Dim xlWorkSheet As Excel.Worksheet = xlWorkBook.Sheets("Sheet1")
答案 0 :(得分:1)
适用于C#
代码,因为它不允许Optional
个参数。在VB中不需要它,但也不会受到伤害。您始终可以指定要提供的参数:paramName:=value