我想在VB.NET(2010)form1中嵌入一个excel工作簿。我尝试了以下但它打开了具有单独的Microsoft excel实例的所需excel文件。目前我正在使用以下方法,当PC更改时,该方法失败。
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
Dim path As String
'Location of excel file
path = ("D:\test.xlsx")
WebBrowser1.Navigate(path)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button2.Click
Me.Close()
End Sub
End Class