Solved

Problem loading webpage in web browser control from excel

Posted on 2011-02-22
7
620 Views
Last Modified: 2013-11-08
Hi,

I have an application in C# which adds custom toolbar to excel. I have a requirement where in I need to load a windows form having a web browser control when one of the buttons of the toolbar is clicked and navigate a web page in that web browser control.

The problem I'm facing is any page navigated from this web browser control is rendering in IE 6.0 format. All the controls in the webpage scrollbars, combo boxes etc. are all rendered in IE 6.0 format when I'm having IE 8.0 in my system.
0
Comment
Question by:pkoivula
  • 4
  • 2
7 Comments
 
LVL 10

Expert Comment

by:John Claes
ID: 34959161
What version does the WebControl Dll have?
You can have an other version of IE installed but still using the older DLL's in your application.

regards

poor beggar
0
 

Author Comment

by:pkoivula
ID: 34959391
Webbrowser is a control of System.Windows.Forms dll whose version is 2.0.50727.3053.

It is working fine when I use the webbrowser in a standalone windows application.
0
 
LVL 33

Expert Comment

by:Todd Gerbert
ID: 34960955
What do you mean by "rendering in IE 6.0 format"?  Have your WebBrowser control navigate to the URL res://ieframe.dll/about.dlg, you should see the Internet Explorer "About" dialog - which will indicate which version of IE the control's using.
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

Author Comment

by:pkoivula
ID: 34968547
It means all the controls of the webpage are shown as in IE 6.0 mode. For Example, scrollbars style is gray in IE 6.0  whereas in IE 7.0 or IE 8.0 it is blue. I'm having windows XP Professional in my system.


In my application the excel toolbar is created using a Shared Addin in Visual Studio 2008. When a windows form having webbrowser control is loaded from excel toolbar button click event, the web page is loaded in IE 6.0 mode whatever maybe the version of IE in the system. I have checked this in Windows 7 system also which comes with IE 8.0 as default browser.
I can see the same problem in Windows 7 system also.


But when I'm loading excel toolbar using automation (not COM) addin, the webpage is loading properly (Web browser works as the version of IE in the system). Plz suggest what could be the problem?
0
 

Author Comment

by:pkoivula
ID: 34994661
I got the root cause for the problem that I was facing with the web browser used in a Shared Addin. I thought the problem is with web browser and the web page is rendering in IE 6.0 format since the webpage appeared to be in some old format.

Actually the problem is with Windows form loaded from a button click in a Excel SharedAddin.
Not only the web browser, if we add windows controls like scroll bars (vertical / horizontal), combobox, radio button, checkbox, button, progressbar etc to the windows form, they are having old style at runtime(like vs 2003 controls).

But still no idea about the solution for this problem.

0
 
LVL 33

Accepted Solution

by:
Todd Gerbert earned 500 total points
ID: 35021489
Googling around, it would seem your add-in needs to call System.Windows.Forms.Application.EnableVisualStyles() prior to showing forms.
0
 

Author Comment

by:pkoivula
ID: 35024080
Thank you...it worked
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
c# string handling 1 27
Why Does This Page Not Show Up? 4 24
SQL Login 17 40
Exit the loop 4 37
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now