?
Solved

Problem loading webpage in web browser control from excel

Posted on 2011-02-22
7
Medium Priority
?
638 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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 2000 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

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

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

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

770 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