C#でExcelファイルを読み書きしているときに少し混乱しています。アプリケーションでInterop.Excel.dllを使用しています。
これで、ローカルマシンで正常に機能しています。そして、MSExcelをインストールしました。しかし、MS Excelがインストールされていないサーバーでこのアプリを実行すると、例外が生成されます。
dllを参照しましたが、MS Excelをインストールする必要がありますか?
案内してください。
これが例外です。
===================START=====================
10/27/2012 7:48:52 PM
System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at ImpExpExcelFile.Form1.generateExcel(String loginId, String fileName, DataSet newValues)
====================END======================
ありがとう :)