Hi, I need to open an excel worksheet within a form I have created in VB. I have done this by adding a webbrowser object to the form. Unfortunately I don't have any excel toobars displayed and can't work out how to enable them. I would appreciate it someone could help me out. The code I have on the form is displayed below :
Public
Class frmOpenXLTestDim strFileName AsStringDim oDocument AsObjectPrivateSub btnBrowse_Click(ByVal sender As System.Object, _ByVal e As System.EventArgs) Handles btnBrowse.Click
'Find the Office document.With OpenFileDialog1
"".FileName =
.ShowDialog()
strFileName = .FileName
EndWith'If the user does not cancel, open the document.If strFileName.Length Then'oDocument = Nothing
WebBrowser1.Navigate(strFileName)
EndIfEndSubPrivateSub frmXLTest_Load(ByVal sender AsObject, ByVal e As _
System.EventArgs) HandlesMyBase.Load
btnBrowse.Text = "Browse"
With OpenFileDialog1"Office Documents "& _"(*.doc, *.xls, *.ppt)|*.doc;*.xls;*.ppt".Filter =
.FilterIndex = 1
EndWith
EndSubPrivateSub frmViewXLTest_Closing(ByVal sender AsObject, ByVal e As _
System.ComponentModel.CancelEventArgs) HandlesMyBase.Closing
oDocument = Nothing
frmOptions.Show()
EndSub
PrivateSub btnCloseXL_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCloseXL.Click
oDocument = Nothing
Me.Close()frmOptions.Show()
EndSub
PrivateSub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
Me.Text = strFileName
EndSub
EndClass