Non-IE WebBrowser ActiveX control
Asked Answered
M

3

10

Google searches are leading me down a bunch of dead ends with this one.
I am developing an Excel add-in in VBA, and part of it involves the use of the WebBrowser control to display a (known) webpage inside a form and access its DOM components.

Unfortunately, this leaves me at the whim of the user's version of Internet Explorer.
For our actual webpages, we can use Chrome Frame support to allow IE users to see the page in the way we intend without worrying about their browser version, but the WebBrowser control does not see the browser plugins.

I have taken a look at WebKit.NET and GeckoFX. They sort of work, but unless I am completely missing something, they don't seem to have Javascript or CSS engines in them at all. Or (in the case of GeckoFX), they are using old engines. That makes them useless.

Is there any ActiveX control that I can embed in a VBA form which works like the WebBrowser control (with a similar-if-not-identical API), uses a different rendering engine that keeps up with the latest version of Mozilla/Chrome/Opera, and still supports Javascript and CSS correctly?

Thank you!

(Some edits based on the comments)

EDITED AGAIN: I found out from one answer below that I was looking at an outdated version of GeckoFX, but the newest version looks promising. But now I have a new related question: How do I include GeckoFX in VBA? Windows does not allow me to register it as a COM object. Do I have to build it myself from source somehow? Or what?

Manning answered 3/11, 2011 at 14:19 Comment(5)
GeckoFX seems to support both CSS and JavaScript. Why do you think it doesn't?Rubella
When I tried pointing it at my test page (which used javascript and jqueryUI), I saw an unadorned ugly CSS-less page. Like I said, maybe I did something wrong.Manning
Oh right, the other thing, the GeckoFX documentation says it works best with Firefox 3.5 engine; I really need something that works with the latest-and-greatest (Firefox 7-ish, or Chrome, or even Opera)Manning
Is it such a problem to rely on IE? IE has a lot of compatibility settings to ensure a common behavior across versions (from 7 to 9 mostly as 6 is almost dead). Cf msdn.microsoft.com/en-us/ie/cc405106Justiciable
Most of the target users of this add-in are, unfortunately, on XP with IE6; we can "strongly suggest" that they upgrade to 8 (but not 9, due to OS restrictions), but if I use the standard WebBrowser, I pretty much have to make sure it works with 6.Manning
A
5

Gecokfx supports Firefox up to 33.0

https://bitbucket.org/geckofx/geckofx/wiki/Version_lists

It supports both Javascript and CSS.

Aweigh answered 8/11, 2011 at 12:11 Comment(4)
If that's the case, then the documentation/homepage for geckofx that I found from google searching was outdated. Thank you for this link, I will take a look.Manning
OK.. followup question that might be dumb: How do I include it in my VBA project? I can't regsvr32 the DLL, and I can't include it as a Reference.Manning
Don't know anything about VB but, its not a COM Dll so you shouldn't have to do regsvr32. If the dll is build with a later version of the .net framework than your are targeting then you may not be able to add it. Its a .net 3.5 I targeted dll I think.Aweigh
VBA (at least for Office 2003, which I am stuck using) isn't .NET . I need to be able to include the GeckoFX DLL in a VBA project. Usually that's by Registering a COM object or adding a "Reference" to one. Is this a larger issue that should be its own separate stackoverflow question? :)Manning
R
0

If you want it to work in elderly VBA you need a browser in an ActiveX wrapper.

The Mozilla ActiveX Control would fit the bill, but that seems to be dead. (It lived on in Mozilla Prism, now Chromeless, but that doesn't have a binary download. And you can apparently build it yourself from the XULRunner source, but that's probably not straightforward.)

It might not be too hard to build GeckoFX as an ActiveX control.

Rubella answered 8/11, 2011 at 20:55 Comment(3)
Not within my skillset to go converting .NET components to ActiveX controls. I am genuinely surprised that nobody has done it already (or that my google skills are that bad).Manning
In other words: for my purposes, using the WebBrowser object and telling my users that their experience will be improved if they have IE8 or 9 is probably good enough. But now it is a matter of curiosity for the future.Manning
I'm also surprised that there doesn't seem to be any currently supported browser-in-ActiveX-control (excepting IE), but I can't find one either.Rubella
F
-1

If you use GeckoFX or Chrome Frame you will be at the mercy of the user's Firefox or Chrome version. No way to solve this problem other than specifying a baseline version for your users.

If you cannot do this I suggest you work around the differences in your VBA code.

In other words: Use the IE WebBrowser control, because it is guaranteed to be installed in some version or another, and either specify a minimum version of IE (I suggest IE6 which everyone should have) and cope with the differences by detecting the version and working around the differences from VBA.

Fitzpatrick answered 11/11, 2011 at 10:28 Comment(1)
That is not true any longer when it comes to GeckoFX, you download and point it to a specific xulrunner (Firefox). The latest version even includes it.Wahoo

© 2022 - 2024 — McMap. All rights reserved.