Code to display HTMl not working, Why?
Hi all,
I have a form that contains a name in a label and a command button.
I have the name displayed on a separate form containing a webBrowser using a string.
When the user clicks the command button, I want to use the name in the label to display the correct HTML file in a web browser on the separate form.
Here' the code I used in the form with the WebBrowser,
Private Sub Form_Load()
If lblShip1.Caption = "Anna Salen" Then
WebBrowser1.Navigate "C:/Documents and Settings/itcoop/Desktop/kiosk/Ships HTML pages/wallofships_grigori/shipsmain/Anna_Salen_NEW.htm"
End If
If lblShip1.Caption = "Andes" Then
WebBrowser1.Navigate "C:/Documents and Settings/itcoop/Desktop/kiosk/Ships HTML pages/wallofships_grigori/shipsmain/Andes_NEW.htm"
End If
If lblShip1.Caption = "Queen Mary" Then
WebBrowser1.Navigate "C:/Documents and Settings/itcoop/Desktop/kiosk/Ships HTML pages/wallofships_grigori/shipsmain/Queen_Mary_NEW.htm"
End If
End Sub
This displays the correct form, but it does not display the HTML page, it just displays the "Page Cannot Be Displayed" page. When I block out the If statements and just have the 'Webbrowser.Navigate' line it displays the page for the second WebBrowser line of code, but not if there are IF statements.
What's wrong with this code?
Thanks,