Originariamente inviato da Pirelli72
Si blocca cosa, dove e quando?
si blocca quando premo il tasto e clicco su apri
ho provato in questo modo:
codice:
Dim oDocument as Object
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
Dim strFileName As String
'Find the Office document.
With OpenFileDialog1
.FileName = ""
.ShowDialog()
strFileName = .FileName
End With
'If the user does not cancel, open the document.
If strFileName.Length Then
oDocument = Nothing
AxWebBrowser1.Navigate(strFileName)
End If
End Sub
Private Sub Form1_Load(ByVal sender As Object, ByVal e As _
System.EventArgs) Handles MyBase.Load
Button1.Text = "Browse"
With OpenFileDialog1
.Filter = "Office Documents " & _
"(*.doc, *.xls, *.ppt)|*.doc;*.xls;*.ppt"
.FilterIndex = 1
End With
End Sub
Private Sub Form1_Closing(ByVal sender As Object, ByVal e As _
System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
oDocument = Nothing
End Sub
e in questo... ma si blocca ugualmente:
codice:
Public Class Form4
Dim oDocument As Object
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
WebBrowser1.Navigate("C:\ciao.xls")
End Sub
End Class