새 C# Windows Forms 응용 프로그램을 만들었습니다. COM 참조 "Microsoft Excel 15.0 Object Library"를 프로젝트에 추가했습니다. 이 프로젝트는 엑셀 데이터를 데이터 세트로 가져 오기위한 것입니다. 나는 해냈다. 나는 내 컴퓨터에서 잘 작동한다. 다른 컴퓨터에서 exe 파일을 실행하면 아래 오류가 표시됩니다.C# Windows 응용 프로그램을 다른 컴퓨터에서 실행하지 못했습니다.
ERROR :
Unable to cast COM object of type Microsoft.Office.Interop.Excel.ApplicationClass’ to interface type ‘Microsoft.Office.Interop.Excel._Application’” This operation failed because the QueryInterface call on the COM component for the interface with IID '{{000208D5-0000-0000-C000-000000000046}' failed due to the following error: Error loading type library/DLL (Exception from HRESULT:0x80029C4A(TYPE_E_CANTLOADLIBRARY)).
(재) 해당 컴퓨터에 Office를 설치에서 진정한 로컬 복사 = 설정하려고 . –
interop을 사용하는 경우 대상 컴퓨터에 동일한 MS Office 버전을 설치해야합니다. – Jaxedin
고맙습니다 @Dirk, @ Jaxedin 너무 많이, 내 오류를 해결, 만약 내가 많은 시스템에 내 모든 응용 프로그램을 실행하고 싶다면, 그 모든 시스템에 동일한 오피스 버전을 설치하는 더 나은 방법. –