 |
|
ผมพัฒนาระบบระบบหนึ่งใช้ภาษา c# ASP.Net มีการ create และ read ไฟล excel เครื่องที่ใช้พัฒนามี window7+office2007 ซึ่งตอนทดลองrunในเครื่องสามารถใช้งานได้ปกติ
ทีนี้ผมต้องนำโปรเจคที่พัฒนาไปใช้บน windowserver2003 แต่ตัวserverนี้ผู้ดูแลเค้าไม่อนุญาตให้ลงoffice2007
ผมจึงไปโหลดไฟล Interop.Microsoft.Office.Core.dll และ Microsoft.Office.Interop.Excel.dll มาใส่ในกล่องbinในโฟลเดอโปรเจค แล้วทำการ add references แต่พอทดลองใช้ ไม่สามารถใช้ได้ จะแจ้งerror
Server Error in '/' Application.
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)).
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.COMException: 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)).
Source Error:
Line 96: Excel.Worksheet NwSheet;
Line 97: Excel.Range ShtRange;
Line 98: appExl = new Excel.Application();
Line 99: workbook = appExl.Workbooks.Open(Server.MapPath("Data/" + FileUpload1.FileName), Missing.Value, Missing.Value,
Line 100: Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value,
Source File: C:\Users\dell\Desktop\AC\AC\templateaddterminal.aspx.cs Line: 98
ไม่ทราบว่าจะแก้ปัญหานี้ยังไงครับ
Tag : ASP.NET, Web (ASP.NET), C#, VS 2010 (.NET 4.x)
|
|
 |
 |
 |
 |
Date :
2012-02-08 23:27:41 |
By :
werasak19978 |
View :
3288 |
Reply :
4 |
|
 |
 |
 |
 |
|
|
|
 |