Where is a reliable registry key to find install location of Excel 2007?

混江龙づ霸主 提交于 2019-12-30 07:27:32

问题


Where is a reliable registry key to find install location of Excel 2007?


回答1:


How about:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\X.0\Common\InstallRoot]

which contains a key named 'Path' with the installation directory of that version of Office. This is consistent for Excel 8.0 through 12.0. If you want to look for a specific product, use Excel, Word, Access, etc., in place of Common.

  • Jon ------- Jon Peltier, Microsoft Excel MVP

From: http://www.developersdex.com/vb/message.asp?p=2677&r=6199020




回答2:


I'm using the following key:

[HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\excel.exe]

If the folder name contains Office12, you've got 2007. I'm using this method to decide during installation to install Office 2000-2003 addins or Office 2007 addins, as well as the folder to install them to.

This is extremely reliable, and also works well with localized versions of Windows. So far we've tested on French, German, Spanish and Italian with much better success than the other methods we were previously using. XLSTART should be the same in all languages, but be wary when developing word addins as "STARTUP" is localized in some cases.




回答3:


Here is another direction you can go. I have not tested this.

http://support.microsoft.com/kb/240794




回答4:


HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\12.0\Excel\InstallRoot\




回答5:


I have found this key to be consistent across all my Office 2007 installations.

[HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components\9B905EB838DBFEE4991CF8E66F518BBF]

If you are reading this, and you have Excel 2007, can you Vote this up (or leave a comment) if it is reliable for you too? (Vote it down, or post a comment if it is wrong?)

NOTE: This is not consistent across my machines.

[HKLM\SOFTWARE\Microsoft\Office\X.0\Common\InstallRoot]


来源:https://stackoverflow.com/questions/244517/where-is-a-reliable-registry-key-to-find-install-location-of-excel-2007

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!