title: VB.NET: Can't load Excel into WebBrowser on Windows Form
body: <p>I am using the following code to load an Excel sheet into a WebBrowser control on a Windows Form, and the msgbox in the Navigated fires, but the sheet is not visible in the WebBrowser.  Also, Navigated2 does not help.  Is there something that's missing?</p>
  
  <p>FYI: the following references to the project are being declared: </p>
  
  <pre><code>Microsoft Office 14.0 Object Library
  Microsoft Excel 14.0 Object Library
  Microsoft Internet Controls
  Microsoft Common Dialog Control 6.0 (SP6)
  </code></pre>
  
  <hr>
  
  <pre><code>Imports Office = Microsoft.Office.Core
  Imports Excel = Microsoft.Office.Interop.Excel
  
  Public Class Form1
      Dim oDocument As Object
      Private xlAPP As New Excel.Application
      Private xlWBook As Excel.Workbook
  
      Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
          ' Create new Application.
  
          Dim filename As String = Nothing
          With OpenFileDialog1
              .CheckFileExists = True
              .ShowReadOnly = True
              .Filter = "Excel files *.xlsx|*.xlsx"
              If .ShowDialog = Windows.Forms.DialogResult.OK Then
                  'Load file
                  filename = .FileName
              End If
          End With
  
          With xlAPP
              .Visible = False
              xlWBook = .Workbooks.Open(filename)
              xlWBook.Activate()
  
          End With
  
          Me.WebBrowser1.Navigate(xlWBook.FullName)
  
      End Sub
  
      Private Sub WebBrowser1_Navigated(ByVal pDisp As Object, URL As Object) Handles WebBrowser1.Navigated
          MsgBox("NavigateComplete Event")
          On Error Resume Next
          oDocument = pDisp.Document
  
      End Sub
      Private Sub WebBrowser1_DocumentCompleted(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
  
          With xlAPP.CommandBars("Standard")
              .Visible = True
  
          End With
      End Sub
  
  End Class
  </code></pre>