Solved

Problem loading webpage in web browser control from excel

Posted on 2011-02-22
7
626 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
Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

 

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

821 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