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, 8 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
-
Phishers extract Millions from HMRC accounts..
by
Microfix
2 hours, 45 minutes ago -
Windows 10 22H2 Update today (5 June) says up-to-date but last was 2025-04
by
Alan_uk
4 hours, 37 minutes ago -
Thoughts on Malwarebytes Scam Guard for Mobile?
by
opti1
7 hours, 45 minutes ago -
Mystical Desktop
by
CWBillow
7 hours, 59 minutes ago -
Meta and Yandex secretly tracked billions of Android users
by
Alex5723
2 hours, 45 minutes ago -
MS-DEFCON 2: Do you need that update?
by
Susan Bradley
58 minutes ago -
CD/DVD drive is no longer recognized
by
WSCape Sand
23 hours, 12 minutes ago -
Windows 11 24H2 Default Apps stuck on Edge and Adobe Photoshop
by
MikeBravo
1 day, 2 hours ago -
North Face and Cartier customer data stolen in cyber attacks
by
Alex5723
1 day ago -
What is wrong with simple approach?
by
WSSpoke36
16 hours, 39 minutes ago -
Microsoft-Backed Builder.ai Set for Bankruptcy After Cash Seized
by
Alex5723
1 day, 11 hours ago -
Location, location, location
by
Susan Bradley
1 hour, 58 minutes ago -
Cannot get a task to run a restore point
by
CWBillow
1 day, 12 hours ago -
Frustrating search behavior with Outlook
by
MrJimPhelps
1 day, 3 hours ago -
June 2025 Office non-Security Updates
by
PKCano
1 day, 23 hours ago -
Secure Boot Update Fails after KB5058405 Installed
by
SteveIT
2 hours, 18 minutes ago -
Firefox Red Panda Fun Stuff
by
Lars220
1 day, 23 hours ago -
How start headers and page numbers on page 3?
by
Davidhs
2 days, 10 hours ago -
Attack on LexisNexis Risk Solutions exposes data on 300k +
by
Nibbled To Death By Ducks
1 day, 12 hours ago -
Windows 11 Insider Preview build 26200.5622 released to DEV
by
joep517
2 days, 18 hours ago -
Windows 11 Insider Preview build 26120.4230 (24H2) released to BETA
by
joep517
2 days, 18 hours ago -
MS Excel 2019 Now Prompts to Back Up With OneDrive
by
lmacri
2 days, 8 hours ago -
Firefox 139
by
Charlie
2 days, 1 hour ago -
Who knows what?
by
Will Fastie
1 day, 3 hours ago -
My top ten underappreciated features in Office
by
Peter Deegan
2 days, 19 hours ago -
WAU Manager — It’s your computer, you are in charge!
by
Deanna McElveen
13 hours, 4 minutes ago -
Misbehaving devices
by
Susan Bradley
1 day, 15 hours ago -
.NET 8.0 Desktop Runtime (v8.0.16) – Windows x86 Installer
by
WSmeyerbos
4 days, 1 hour ago -
Neowin poll : What do you plan to do on Windows 10 EOS
by
Alex5723
1 day ago -
May 31, 2025—KB5062170 (OS Builds 22621.5415 and 22631.5415 Out-of-band
by
Alex5723
3 days, 23 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.