none
“ieframe.dll”: for InternetExplorer or for WebBrowser? RRS feed

  • Question

  • Hi,

    In VSTO 2010, I need to add web browsing ability to my excel document-level project. From VS 2010ProjectAdd reference, I found “Microsoft internet Controls” which corresponds to “ieframe.dll”.

    On the other hand, http://msdn.microsoft.com/en-us/library/ie/aa752043(v=vs.85).aspx says there are two objects to use for browsing: InternetExplorer & WebBrowser. Which one is associated with “ieframe.dll” above? How to add the other one?

    Bob


    Wednesday, February 22, 2012 7:57 PM

Answers

  • I dragged webbrowser control from Toolbox->DCommon contorls onto excel sheet and added Navigate("http://www.google.com") in sheet startup event. It showed contents of web page. Please remember that web browser is a asynchronous beast, contents will not show up immediatly after call to navigate. Maybe attach also to DocumentCompleted event in your web browser and popup some msg box to inform you that content is rendered. Only then if you see nothing you should worry. Try this and let us know of results.
    Friday, February 24, 2012 9:50 AM

All replies

  • Why do you need to reference ieframe.dll? Use WebBrowser control from System.Windows.Forms namespace.

    Thursday, February 23, 2012 9:13 AM
  • Damien,

    If I just drag and draw a WebBrwoser control from the toolbox into an Excel sheet, it seems at runtime its content is not displayed after navigating to an URL. The code is:

    WebBrowser1.Navigate(www.google.com)

    I read from http://msdn.microsoft.com/en-us/library/8chd8dsh(v=vs.80).aspx that "New" should not be used to create a new instance, but should instead use AddWebBrowser. But since I have already dragged and drawn the control in the worksheet, do I still have to instantiate it again? It seems that normally if you have drawn a control in the worksheet, then you don't have to manually write code to create it again, for example, one doesn't have to instantiate a button after already drawing it in the worksheet.

    But why my code above doesn't display anything?

    Bob

    Thursday, February 23, 2012 3:47 PM
  • I thought you were using Windows Forms form to display something. In your case i would follow advice from msdn and remove webbrowser added in design time and add it with AddWebBrowser in runtime. Please check it and see if it works.
    Thursday, February 23, 2012 3:57 PM
  • Damien,

    I was not using Windows forms at all (which I have confirmed by checking the namespace), but only the WebBrowser control available in the Excel toolbox. Could you have a try on your machine and see if the webpage can get displayed?

    Bob

    Thursday, February 23, 2012 4:05 PM
  • I dragged webbrowser control from Toolbox->DCommon contorls onto excel sheet and added Navigate("http://www.google.com") in sheet startup event. It showed contents of web page. Please remember that web browser is a asynchronous beast, contents will not show up immediatly after call to navigate. Maybe attach also to DocumentCompleted event in your web browser and popup some msg box to inform you that content is rendered. Only then if you see nothing you should worry. Try this and let us know of results.
    Friday, February 24, 2012 9:50 AM
  • Damian,

    I eventually circumvented the problem by using some other scripting language rather than automating IE, but thanks all the same for the reply.

    Bob

    Sunday, March 11, 2012 4:10 PM