Help with WebBrowser control

KiaOrana

New Member
Joined
Jan 29, 2012
Messages
15
Hi guys,

I have an issue with a WebBrowser control. I have a WebBrowser form in my workbook which worked really well until I got upgraded from Excel 07 to Excel 10 and from win xp to win7.

Now, instead of displaying the website, I got an error "This program cannot display the webpage" as if Excel does not have acess to the net anymore. I checked my firewall and created an exception rule for excel but it does not seem to be the issue as it still does not work.


I use the basic code

Private Sub Worksheet_Activate()

WebBrowser1.Navigate2 "http://www.google.com"

End Sub

I created a file with just the WebBrowser form so you can have a look to see if it works on your system or if it comes to an issue with the code.

http://dl.dropbox.com/u/8843455/webbrowsertest.xlsm

I really need help with this, any input will be much appreciated!

Thanks a lot
 
I downloaded your document and it does work if you select another sheet and then go back to sheet1.

I think the issue is that if macros are disabled when you open the workbook sheet1 is already activated thus skipping the actual event.

When you enable the macros you have to initialize the sheet again.

Just my experiance with it.
 
Upvote 0
That's crazy! It does indeed work when changing sheet!

Thanks a lot for pointing that.

It's really annoying tho, because the form is meant to sit in a dashboard used by my management and I don't want them to have to fiddle with the sheets in order to see the page display properly. I wonder if there's anything I can do to make it work directly.

Anyway, thanks a lot mate!
 
Upvote 0
Sorry i think my thought process is wrong.

Either way your better off putting this in the workbook open event.
will work everytime.

Code:
Private Sub Workbook_Open()
Sheet1.WebBrowser1.Navigate2 "[URL]http://www.microsoft.com[/URL]"
End Sub
 
Upvote 0
Thanks a lot for your help.

I'll be honest with you, I'm struggling a bit with VBA, I'm learning on the go. If I send you a link in PM, do you think you could have a look at something I've done?

I send you a PM.
 
Upvote 0

Forum statistics

Threads
1,226,850
Messages
6,193,335
Members
453,790
Latest member
yassinosnoo1

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top