110,536
社区成员
发帖
与我相关
我的任务
分享
var missing = System.Reflection.Missing.Value;
Application excel = new Application(); //lauch excel application
if (excel == null)
{
//TODO:读不到这个Excel
}
else
{
excel.Visible = false;
excel.UserControl = true;
Workbook wb = excel.Application.Workbooks.Open(path, missing, true, missing, missing, missing,
missing, missing, missing, true, missing, missing, missing, missing, missing);
Worksheet ws = (Worksheet)wb.Worksheets.get_Item(1);
.....
Server Error in '/' Application.
The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))
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: The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))
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 (0x80010105): The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))]
Microsoft.Office.Interop.Excel.Workbooks.Open(String Filename, Object UpdateLinks, Object ReadOnly, Object Format, Object Password, Object WriteResPassword, Object IgnoreReadOnlyRecommended, Object Origin, Object Delimiter, Object Editable, Object Notify, Object Converter, Object AddToMru, Object Local, Object CorruptLoad) +0
Core.Store.NewImpStorage.ReadProdDataFromExcel(String path, Int32 shopId, Int32 startRowNum, String& errorTxt) in D:\Pro_SVN\trunk\Core\Store\NewImpStorage.cs:58
views.impproddata.updateexcel.Button1_Click(Object sender, EventArgs e) in D:\Pro_SVN\trunk\views\impproddata\updateexcel.aspx.cs:50
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +115
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +140
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +29
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2981
Version Information: Microsoft .NET Framework Version:2.0.50727.3082; ASP.NET Version:2.0.50727.3082