现在有出现了一个问题,我怎么才能把值填入excel指定的单元格中呢????我查了一下网上的代码,但是不能运行
各位高手帮我看看是哪里出错啦!
Dim x As String
If OpenFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
x = OpenFileDialog1.FileName
End If
Dim mExcel As Object = CreateObject("Excel.Application")
Dim App As New Microsoft.Office.Interop.Excel.Application
Dim xlBook As New Microsoft.Office.Interop.Excel.Workbook
Dim xlSheet As New Microsoft.Office.Interop.Excel.Worksheet
mExcel.Workbooks.Open(x)
mExcel.Visible = True
xlSheet.Cells(14, 4) = "0712001"
App = Nothing '交还控制给Excel
xlBook = Nothing
xlSheet = Nothing