Excel问题 [英] Excel Issue
问题描述
我正在将Excel嵌入到WinForm中.它使用程序集-AxInterop.EXCELLib和Interop.EXCELLib
I am embedding Excel in my WinForm. It uses assemblies - AxInterop.EXCELLib and Interop.EXCELLib
但是,在某些较新的PC(但全为64位)上,出现此错误...
However, on some newer PCs (but all 64bit) I get this error...
"加载显示报告控件时出错.未注册的类(HResult的异常:0x80040154(REGDB_E_CLASSNOTREG))"
"Error loading Display Report Control. Class not registered (Exception from HResult: 0x80040154 (REGDB_E_CLASSNOTREG))"
private AxEXCELLib.AxEXCEL ExcelViewer;
this.ExcelViewer = new AxEXCELLib.AxEXCEL();
((System.ComponentModel.ISupportInitialize)(this.ExcelViewer)).BeginInit();
// fails here...
((System.ComponentModel.ISupportInitialize)(this.ExcelViewer)).EndInit();
任何想法为何?项目解决方案已经设置为x86.
Any ideas why? The project solution has already been set to x86.
谢谢
推荐答案
You are trying to embed a 32-bit ocx in a 64-bit application.
Your application will probably run just fine if you force to run as a 32-bit application on a 64-bit OS.
希望这对您有帮助...
Hope this helps...
Rajat.
这篇关于Excel问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!