简体   繁体   English

通过直接程序路径在Excel VBA中打开Internet Explorer

[英]Open Internet Explorer In Excel VBA through direct program path

I had an excel macro used to open an internet explorer application and manipulate the program. 我有一个excel宏,用于打开Internet Explorer应用程序并操纵该程序。 It worked perfectly for quite some time. 它在相当长的一段时间内运行良好。 However, some of my users have discovered that they need 64 bit internet explorer running in order to maintain some of their printing preferences (the macro automatically prints pages from our website). 但是,我的一些用户发现他们需要运行64位Internet Explorer才能维护某些打印首选项(该宏会自动从我们的网站打印页面)。 The macro could work if the internet explorer program was launched from the link C:\\Program Files\\Internet Explorer\\IExplore.exe. 如果从链接C:\\ Program Files \\ Internet Explorer \\ IExplore.exe启动了Internet Explorer程序,则该宏可以工作。

My previous code to open the ie program was: 我以前打开ie程序的代码是:

Set ie = CreateObject("InternetExplorer.Application")
ie.Visible = True
ie.navigate ("URL")

How can I make it so that my object ie specifically opens the internet explorer through the file path C:\\Program Files\\Internet Explorer\\IExplore.exe and creates it as the object just as it did previously? 我如何才能使我的对象(即通过文件路径C:\\ Program Files \\ Internet Explorer \\ IExplore.exe专门打开Internet Explorer,并像以前一样将其创建为对象)? The internet explorer installed on our computers is ie9 if that matters. 如果重要的话,我们计算机上安装的Internet Explorer是ie9。

The so-called Desktop version of IE (not the Metro version) runs a 64-bit IE frame with all IE windows being 32-bit. IE的所谓桌面版本(不是Metro版本)运行64位IE框架,而所有IE窗口均为32位。 This is accomplished by Windows shipping default with both 64-bit (in Program Files) and 32-bit (in Program Files (x86)) versions of IE. Windows出厂默认使用IE的64位(程序文件)和32位(程序文件(x86))版本来完成此操作。 Microsoft doesn't want people to run Desktop version of IE. 微软不希望人们运行IE的桌面版本。 Their most excellent reasoning is in the article by an Internet Explorer manager at Q&A: 64-Bit Internet Explorer . Q&A的Internet Explorer经理在文章中提到了他们最出色的推理:64位Internet Explorer The 64-bit version of Internet Explorer 9 cannot be set up as the default browser either. 也不能将64位版本的Internet Explorer 9设置为默认浏览器。

The following from your Q might suggest another way of attacking this: However, some of my users have discovered that they need 64 bit internet explorer running in order to maintain some of their printing preferences : Why is this so and does it have anything to do with the bit-ness of the printer drivers installed? 您的Q中的以下内容可能提出了另一种攻击方法: However, some of my users have discovered that they need 64 bit internet explorer running in order to maintain some of their printing preferences :为什么这样做,它有什么作用?安装打印机驱动程序的位?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM