2008-10-31 40 views
5

任何熟悉以下錯誤的人員?當我運行我的webapp從我的本地機器生成動態excel文檔時,它工作正常,但是當在服務器上調用同一段代碼時,出現以下錯誤。這似乎是一個權限問題,因爲它在我的機器上工作,但不是服務器,但我不知道從哪裏開始以查明問題。任何指導/幫助非常感謝!在ASP.NET中動態生成Excel文檔時出現「許可證過期」錯誤

Server Error in '/' Application. 
-------------------------------------------------------------------------------- 

This command is unavailable because the license to use this application has expired. 
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: This command is unavailable because the license to use this application has expired. 

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 

Stack Trace: 


[COMException (0x800a03ec): This command is unavailable because the license to use this application has expired.] 
    Microsoft.Office.Interop.Excel.Workbooks.Add(Object Template) +0 
    PaymentsReport.Page_Load(Object sender, EventArgs e) +70 
    System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15 
    System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +34 
    System.Web.UI.Control.OnLoad(EventArgs e) +99 
    System.Web.UI.Control.LoadRecursive() +47 
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061 

辦公室/ Excel中被安裝在服務器上,我可以打開/保存在服務器上的Excel文檔。它可能是服務器上的excel版本與我的本地機器?如果是這樣,我怎麼能確保我有最新的服務器?

回答

1

使用Office Interop要求您使用的Office組件實際上安裝在服務器上。

0

您是否擁有服務器上的Excel許可,激活副本?它可能適用於本地計算機,因爲您已在本地安裝了Office/Excel。

1

我想要一個WAG,並說你不能在服務器上拍攝任何Office的舊副本,並讓多個用戶通過你的網站訪問它。您需要查看在服務器環境中使用MS Office的許可限制。