
问题描述:
这个问题产生的原因,与 office 的安装有关。
参考:How to solve “Unable to cast COM object of type Microsoft.Office.Interop.Excel.ApplicationClass’ to interface type ‘Microsoft.Office.Interop.Excel._Application’”
文中碰到的问题就是安装了 office 2007,又安装了 office project 2010,在程序运行时,本应执行 HKCR\TypeLib\{00020813-0000-0000-C000-000000000046}\1.6
,却去访问了 HKCR\TypeLib\{00020813-0000-0000-C000-000000000046}\1.7
。
解决方法:
- 删除注册表中的项
HKEY_CLASSES_ROOT\TypeLib\{00020813-0000-0000-C000-000000000046}\1.7

