PDA

View Full Version : Word 2010 VBA reference to IE?



eed
08-26-2011, 01:34 PM
Hello, VBAx community! I need to borrow your expertise.

I wrote a script in Word 2007 which needs to launch Internet Explorer.

We recently upgraded to Word 2010, and the script is having issues. (It works fine on MY computer, but not on colleagues' machines, so I am wondering if maybe some setting or permission is missing or wrong?) All workstations are running IE version 7 and Windows XP Pro, same as before the MS Office upgrade.

I tried both of the following methods for initiating an instance of IE, but both fail on my colleagues' machine:


Dim appIE As InternetExplorer
Set appIE = New InternetExplorer
' this is the method that we used in Word 2007, along with turning
' on a reference in the VBA Editor to "Microsoft Internet Controls."
' That reference no longer appears for us in Word 2010.

Dim appIE As SHDocVw.InternetExplorer
Set appIE = CreateObject("InternetExplorer.Application")
' this method works for me in Word 2010
' but does not work for my colleagues.


Any suggestions for a better method of launching IE from VBA in Word, or any suggestions of settings or permissions that I should check on my colleagues' machine?? Many, many thanks in advance for any help.

~ Erin

Frosty
08-29-2011, 08:42 AM
You could also use the Shell command (I've only ever needed to open up a specific page--I have a feeling this will be inadequate to your needs), but the following has worked in both Word 2003 and Word 2010:

Shell ("C:\Program Files\Internet Explorer\IEXPLORE.EXE http://intranet/"), vbNormalFocus

Even knowing this probably won't help, I'm just pointing out another approach which has worked, even on the tightened security of Windows 7.