2012-08-14 11 views
2

내가 foll을 추가 할 때. 코드하지만 서버에 표시 오류가 있습니다. 코드 -파일 또는 어셈블리를로드 할 수 없습니다 'Microsoft.Office.Interop.Excel, 버전 = 12.0.0.0, 문화 = 중립, PublicKeyToken = 71e9bce111e9429c'

object oMissing = System.Reflection.Missing.Value; 
         Microsoft.Office.Interop.Excel.ApplicationClass xl = new Microsoft.Office.Interop.Excel.ApplicationClass(); 
         Microsoft.Office.Interop.Excel.Workbook xlBook; 
         Microsoft.Office.Interop.Excel.Worksheet xlSheet; 
         xlBook = (Workbook)xl.Workbooks.Open(docPath, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing); 
         xlSheet = (Worksheet)xlBook.Worksheets.get_Item(1); 
         xlSheet.Name = "Sheet1"; 
         xlBook.Save(); 
         xl.Application.Workbooks.Close(); 

오류가 -

System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Office.Interop.Excel, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified. 

나는 웹 어플리케이션에서 "Microsoft.Office.Interop.Excel"DLL의 참조를 추가했습니다. 로컬에서는 잘 작동합니다. 참고 : 서버에 Microsoft Office가 설치되어 있지 않습니다. 서버에 설치하지 않고도이 문제를 해결할 수 있습니까?

+2

아니요 .. 사무실에 설치해야합니다. –

+0

네, 맞습니다. 감사합니다 – Abhi

답변

2

excel을 설치하지 않고 Microsoft.Office.Interop.Excel을 사용할 수 없습니다. 하지만 대신 서버에서 EPPlus을 사용할 수 있습니다

+0

제가 이것을 시도하게 .. .. 감사합니다 Logged – Abhi

관련 문제