What is the exact code you use the next time around? Switching to a different URL worked without problem in a quick test I did.
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Answer – Gurus – WebBrowser.Navigate (Office XP)
Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » Answer – Gurus – WebBrowser.Navigate (Office XP)
- This topic has 42 replies, 4 voices, and was last updated 20 years, 7 months ago.
Viewing 3 reply threadsAuthorReplies-
WSplarb
AskWoody LoungerOctober 11, 2004 at 5:06 am #886945Hans,
please test inside Word XP, Windows XP SP2.
URL’s were on a server. Thus the URL will be something like this:
sURL = “C:Documents and Settingsusermyfile1.htm”
and for example:
sURL = “C:Documents and Settingsusermyfile2.htm”
Thus on navigate the code will be:
myWebbrowser.Navigate sURL
and obviously flick to the second URL on a “click” event – the click event
I just can’t understand why the second URL errors out…? for me that is.
I will now create 2 files with “Helloworld_1” text and “Helloworld_2” text inside “.htm” file extensions.
Thanks
Pete
-
WSHansV
AskWoody LoungerOctober 11, 2004 at 5:22 am #886949I am using Word 2002 SP3 on Windows XP Pro SP2. I tried this with some existing .htm files, and had no problem switching between them. If I specified the name of a non-existent file, the standard “The page cannot be displayed” message was shown inside the browser control itself, I didn’t get an error message.
I have also searched the Microsoft newsgroups, but I couldn’t find anything relevant.
-
WSplarb
AskWoody LoungerOctober 11, 2004 at 5:27 am #886951Hans,
firstly thanks for the replies.
Refer attached.
Steps:
1. Templates folder loads and I select a template to view the relevant Help documents.
On this “first” pass evwerything is great – no problems
2. Go back to the list of Templates and select a second “different” template.
Choose Help – browser looks for new file and the error occurs !
My examlpe of looking for “HelloWorld_1” and “_2” worked fine ! can you believe it.
But following the above steps bombs !
Thanks
Pete
-
WSplarb
AskWoody Lounger -
WSplarb
AskWoody Lounger -
WSHansV
AskWoody Lounger -
WSHansV
AskWoody Lounger -
WSHansV
AskWoody LoungerOctober 11, 2004 at 7:22 am #886963 -
WSplarb
AskWoody LoungerOctober 11, 2004 at 11:17 am #886994 -
WSHansV
AskWoody Lounger -
WSHansV
AskWoody Lounger -
WSpieterse
AskWoody Lounger -
WSpieterse
AskWoody Lounger -
WSjscher2000
AskWoody Lounger -
WSplarb
AskWoody LoungerOctober 11, 2004 at 8:53 pm #887219Good morning from Sydney,
1. navigate2 is no different from Navigate as per MSDN ?, but you never know – I will try it
2. Windows XP SP2 – unfortunatley all of our work PC’s have been service packed. I tried on Office 2003 and Win XP SP 2 and the same result.
The interesting thing with this WebBrowser control is the need to make the control invisible and then visible for it to work properly.
I have zipped my form and will post now.
Please note that I have commented out my listbox control code and now launch from a “test” commandbutton.
I still think it is a Visible/ invisible flag.
What I am going to do is make the form bigger for testing purposes and put all controls on the one page and not use a multipage control.
Thanks for all your help
Peter
-
WSHansV
AskWoody LoungerOctober 11, 2004 at 9:24 pm #887231You don’t believe in making it easy for us, do you? The code behind the form refers to at least one class module that is not included in your zip file, so I can’t test it. By the time I strip out most of it, and just use the command buttons to open different files into the web browser control, it works OK.
-
WSplarb
AskWoody LoungerOctober 11, 2004 at 9:36 pm #887237Sorry Hans about the class file.
The problem herein lies when changing from the Page 1 to Page 2 in the multi-page control.
Did you try and load different URL’s after changing pages ? – the WebBrowser shouldn’t work if my theory is correct.
1. Load first URL
2. move back to Page 1 of the MultiPage and choose a different URL
3. Choose the Help page and view the 2nd URL – this is when teh WebBrowser “should” error.
Thanks
Pete
-
WSHansV
AskWoody Lounger -
WSplarb
AskWoody Lounger -
WSHansV
AskWoody Lounger -
WSplarb
AskWoody LoungerOctober 12, 2004 at 12:33 am #887295Answer:
you can NOT use a WebBrowser control on a MultiPage control – and that’s it !
Workaround: they are bad but this is the only answer.
1. Minimise the MultiPage control to a height say 17. This makes the user think they are working on a multi page but they are not ! yes, you do not get the good looking layered and edging effect.
2. Layer your controls over each other and make them visible / invisible depening upon what they click.
In other words bring to the webbrowser control to the front when needs be and make sure it can hide behind another control in the meantime.
Then the you will have no erros when navigating to new URL’s.
Pete
-
WSplarb
AskWoody LoungerOctober 12, 2004 at 12:33 am #887296Answer:
you can NOT use a WebBrowser control on a MultiPage control – and that’s it !
Workaround: they are bad but this is the only answer.
1. Minimise the MultiPage control to a height say 17. This makes the user think they are working on a multi page but they are not ! yes, you do not get the good looking layered and edging effect.
2. Layer your controls over each other and make them visible / invisible depening upon what they click.
In other words bring to the webbrowser control to the front when needs be and make sure it can hide behind another control in the meantime.
Then the you will have no erros when navigating to new URL’s.
Pete
-
WSHansV
AskWoody Lounger -
WSplarb
AskWoody Lounger -
WSHansV
AskWoody Lounger -
WSjscher2000
AskWoody LoungerOctober 11, 2004 at 10:24 pm #887259This is beginning to sound like a problem I ran into back in August 2003. I don’t remember whether I posted about it, but I found my test form. My problem was that when I switched to the second tab, which was going to list information about forms on the page, and then switched back to the first tab, the webbrowser control was no longer there. The control’s .LocationURL was blank… I tried repainting, I tried a bunch of things. Eventually, I just gave up because it wasn’t a really critical experiment. I figured someday I would try again using pure VB or a different host.
-
WSjscher2000
AskWoody LoungerOctober 11, 2004 at 10:24 pm #887260This is beginning to sound like a problem I ran into back in August 2003. I don’t remember whether I posted about it, but I found my test form. My problem was that when I switched to the second tab, which was going to list information about forms on the page, and then switched back to the first tab, the webbrowser control was no longer there. The control’s .LocationURL was blank… I tried repainting, I tried a bunch of things. Eventually, I just gave up because it wasn’t a really critical experiment. I figured someday I would try again using pure VB or a different host.
-
WSplarb
AskWoody LoungerOctober 11, 2004 at 9:36 pm #887238Sorry Hans about the class file.
The problem herein lies when changing from the Page 1 to Page 2 in the multi-page control.
Did you try and load different URL’s after changing pages ? – the WebBrowser shouldn’t work if my theory is correct.
1. Load first URL
2. move back to Page 1 of the MultiPage and choose a different URL
3. Choose the Help page and view the 2nd URL – this is when teh WebBrowser “should” error.
Thanks
Pete
-
WSHansV
AskWoody LoungerOctober 11, 2004 at 9:24 pm #887232You don’t believe in making it easy for us, do you? The code behind the form refers to at least one class module that is not included in your zip file, so I can’t test it. By the time I strip out most of it, and just use the command buttons to open different files into the web browser control, it works OK.
-
WSplarb
AskWoody LoungerOctober 11, 2004 at 8:53 pm #887220Good morning from Sydney,
1. navigate2 is no different from Navigate as per MSDN ?, but you never know – I will try it
2. Windows XP SP2 – unfortunatley all of our work PC’s have been service packed. I tried on Office 2003 and Win XP SP 2 and the same result.
The interesting thing with this WebBrowser control is the need to make the control invisible and then visible for it to work properly.
I have zipped my form and will post now.
Please note that I have commented out my listbox control code and now launch from a “test” commandbutton.
I still think it is a Visible/ invisible flag.
What I am going to do is make the form bigger for testing purposes and put all controls on the one page and not use a multipage control.
Thanks for all your help
Peter
-
WSjscher2000
AskWoody Lounger -
WSplarb
AskWoody LoungerOctober 11, 2004 at 9:20 pm #887227Some answers:
1. I placed all of my controls onto a single – I removed the multipage control
Thus what I had thought – re. the visible state of the WebBrowser control was at fault.
NOw all my code works.
BUT, BUT I want and need a multipgae control otherwise my form looks stupid as it is very cluttered.
Any ideas gurus?
Thanks
Pete
-
WSplarb
AskWoody LoungerOctober 11, 2004 at 9:20 pm #887228Some answers:
1. I placed all of my controls onto a single – I removed the multipage control
Thus what I had thought – re. the visible state of the WebBrowser control was at fault.
NOw all my code works.
BUT, BUT I want and need a multipgae control otherwise my form looks stupid as it is very cluttered.
Any ideas gurus?
Thanks
Pete
-
WSplarb
AskWoody LoungerOctober 11, 2004 at 11:17 am #886995
-
-
WSHansV
AskWoody LoungerOctober 11, 2004 at 7:22 am #886964
-
-
WSplarb
AskWoody LoungerOctober 11, 2004 at 5:27 am #886952Hans,
firstly thanks for the replies.
Refer attached.
Steps:
1. Templates folder loads and I select a template to view the relevant Help documents.
On this “first” pass evwerything is great – no problems
2. Go back to the list of Templates and select a second “different” template.
Choose Help – browser looks for new file and the error occurs !
My examlpe of looking for “HelloWorld_1” and “_2” worked fine ! can you believe it.
But following the above steps bombs !
Thanks
Pete
-
-
WSHansV
AskWoody LoungerOctober 11, 2004 at 5:22 am #886950I am using Word 2002 SP3 on Windows XP Pro SP2. I tried this with some existing .htm files, and had no problem switching between them. If I specified the name of a non-existent file, the standard “The page cannot be displayed” message was shown inside the browser control itself, I didn’t get an error message.
I have also searched the Microsoft newsgroups, but I couldn’t find anything relevant.
-
-
WSplarb
AskWoody LoungerOctober 11, 2004 at 5:06 am #886946Hans,
please test inside Word XP, Windows XP SP2.
URL’s were on a server. Thus the URL will be something like this:
sURL = “C:Documents and Settingsusermyfile1.htm”
and for example:
sURL = “C:Documents and Settingsusermyfile2.htm”
Thus on navigate the code will be:
myWebbrowser.Navigate sURL
and obviously flick to the second URL on a “click” event – the click event
I just can’t understand why the second URL errors out…? for me that is.
I will now create 2 files with “Helloworld_1” text and “Helloworld_2” text inside “.htm” file extensions.
Thanks
Pete
-
WSplarb
AskWoody LoungerOctober 12, 2004 at 1:15 am #886939Method ‘Navigate’ of object ‘IWebBrowser2’ failed
Afternoon,
I am using the webbrowser control on a form.
– yes, I have searched extensively on Google
1. set the URL for example:
Me.WebBrowser.Navigate “about:blank”
2. problem arises when I change the path the next time around. Fo rexample on the “click” event of a button.
I receive the following error:
Method ‘Navigate’ of object ‘IWebBrowser2’ failedAny ideas?
Thanks
Pete
-
WSplarb
AskWoody LoungerOctober 11, 2004 at 5:13 am #886947Sub ShowURL()
On Error GoTo ErrorHandler
If Me.WebBrowser.ReadyState = READYSTATE_COMPLETE Then
‘READYSTATE_UNINITIALIZED = 0,
‘READYSTATE_LOADING = 1,
‘READYSTATE_LOADED = 2,
‘READYSTATE_INTERACTIVE = 3,
‘READYSTATE_COMPLETE = 4Me.WebBrowser.Navigate CONST_DIR & Me.lstHelpFiles.Value & “.htm”
lblUpdate.Caption = Me.lstHelpFiles.Value
End If
‘ reset error handler to defaultExit Sub
ErrorHandler:
‘only writing to the debug window due to error problems – will delete when running perfectly
Debug.Print Err.Description
End Sub -
WSplarb
AskWoody LoungerOctober 11, 2004 at 5:13 am #886948Sub ShowURL()
On Error GoTo ErrorHandler
If Me.WebBrowser.ReadyState = READYSTATE_COMPLETE Then
‘READYSTATE_UNINITIALIZED = 0,
‘READYSTATE_LOADING = 1,
‘READYSTATE_LOADED = 2,
‘READYSTATE_INTERACTIVE = 3,
‘READYSTATE_COMPLETE = 4Me.WebBrowser.Navigate CONST_DIR & Me.lstHelpFiles.Value & “.htm”
lblUpdate.Caption = Me.lstHelpFiles.Value
End If
‘ reset error handler to defaultExit Sub
ErrorHandler:
‘only writing to the debug window due to error problems – will delete when running perfectly
Debug.Print Err.Description
End Sub
-
-
WSplarb
AskWoody LoungerOctober 12, 2004 at 1:15 am #886940Method ‘Navigate’ of object ‘IWebBrowser2’ failed
Afternoon,
I am using the webbrowser control on a form.
– yes, I have searched extensively on Google
1. set the URL for example:
Me.WebBrowser.Navigate “about:blank”
2. problem arises when I change the path the next time around. Fo rexample on the “click” event of a button.
I receive the following error:
Method ‘Navigate’ of object ‘IWebBrowser2’ failedAny ideas?
Thanks
Pete
Viewing 3 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Login screen icon
by
CWBillow
1 hour, 14 minutes ago -
AI coming to everything
by
Susan Bradley
2 hours, 51 minutes ago -
Mozilla : Pocket shuts down July 8, 2025, Fakespot shuts down on July 1, 2025
by
Alex5723
5 hours, 1 minute ago -
No Screen TurnOff???
by
CWBillow
5 hours, 23 minutes ago -
Identify a dynamic range to then be used in another formula
by
BigDaddy07
5 hours, 56 minutes ago -
InfoStealer Malware Data Breach Exposed 184 Million Logins and Passwords
by
Alex5723
17 hours, 33 minutes ago -
How well does your browser block trackers?
by
n0ads
3 hours, 50 minutes ago -
You can’t handle me
by
Susan Bradley
8 hours, 15 minutes ago -
Chrome Can Now Change Your Weak Passwords for You
by
Alex5723
3 hours, 19 minutes ago -
Microsoft: Over 394,000 Windows PCs infected by Lumma malware, affects Chrome..
by
Alex5723
1 day, 4 hours ago -
Signal vs Microsoft’s Recall ; By Default, Signal Doesn’t Recall
by
Alex5723
8 hours, 25 minutes ago -
Internet Archive : This is where all of The Internet is stored
by
Alex5723
1 day, 5 hours ago -
iPhone 7 Plus and the iPhone 8 on Vantage list
by
Alex5723
1 day, 5 hours ago -
Lumma malware takedown
by
EyesOnWindows
17 hours, 40 minutes ago -
“kill switches” found in Chinese made power inverters
by
Alex5723
1 day, 14 hours ago -
Windows 11 – InControl vs pausing Windows updates
by
Kathy Stevens
1 day, 14 hours ago -
Meet Gemini in Chrome
by
Alex5723
1 day, 18 hours ago -
DuckDuckGo’s Duck.ai added GPT-4o mini
by
Alex5723
1 day, 18 hours ago -
Trump signs Take It Down Act
by
Alex5723
2 days, 2 hours ago -
Do you have a maintenance window?
by
Susan Bradley
6 hours, 59 minutes ago -
Freshly discovered bug in OpenPGP.js undermines whole point of encrypted comms
by
Nibbled To Death By Ducks
1 day, 4 hours ago -
Cox Communications and Charter Communications to merge
by
not so anon
2 days, 5 hours ago -
Help with WD usb driver on Windows 11
by
Tex265
14 hours, 1 minute ago -
hibernate activation
by
e_belmont
2 days, 14 hours ago -
Red Hat Enterprise Linux 10 with AI assistant
by
Alex5723
2 days, 18 hours ago -
Windows 11 Insider Preview build 26200.5603 released to DEV
by
joep517
2 days, 21 hours ago -
Windows 11 Insider Preview build 26120.4151 (24H2) released to BETA
by
joep517
2 days, 21 hours ago -
Fixing Windows 24H2 failed KB5058411 install
by
Alex5723
1 day, 17 hours ago -
Out of band for Windows 10
by
Susan Bradley
3 days, 2 hours ago -
Giving UniGetUi a test run.
by
RetiredGeek
3 days, 9 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.