الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

مشكلة مع تصدير البيانات من Asp.net ل Excel

بدأه TYEF في 29 أبريل 2008 · 0 رد · 774 مشاهدة · في ASP.NET
مشاركة: واتساب X فيسبوك تيليجرام
#1

هذا ملف يحتوى على موقع ويب صغير به كود ليقوم بتصدير قيمة واحدة لملف اكسل الكود صغير والغريبة ان لما بفتحWebDeveloper واعمل مشروع واضيف الكود

ده لصفحة Default.aspx.vb فى حث الصفحة Load يعمل وبدون اى مشاكل

حاولت تطبيقه بدون Web Developer بيقولى

 
Server Error in '/R' Application. 

Microsoft Office Excel cannot access the file 'C:\inetpub\wwwroot\R\R.xlsx'. There are several possible reasons:

• The file name or path does not exist.
• The file is being used by another program.
• The workbook you are trying to save has the same name as a currently open workbook. 
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: Microsoft Office Excel cannot access the file 'C:\inetpub\wwwroot\R\R.xlsx'. There are several possible reasons:

• The file name or path does not exist.
• The file is being used by another program.
• The workbook you are trying to save has the same name as a currently open workbook.

Source Error: 

Line 16:		 '   System.IO.File.Delete("D:\R.xlsx")Line 17:		 'End IfLine 18:		 oBooks = oExcel.Workbooks.Open(Server.MapPath("/R/R.xlsx"))Line 19:		 oExcel.Cells(1, 2) = "Ah"Line 20:		 System.Threading.Thread.CurrentThread.CurrentCulture = oldCI
Source File: C:\inetpub\wwwroot\R\R.aspx	Line: 18 

Stack Trace: 

[COMException (0x800a03ec): Microsoft Office Excel cannot access the file 'C:\inetpub\wwwroot\R\R.xlsx'. There are several possible reasons:• The file name or path does not exist.• The file is being used by another program.• The workbook you are trying to save has the same name as a currently open workbook.]   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   ASP.r_aspx.Page_Load(Object Sender, EventArgs E) in C:\inetpub\wwwroot\R\R.aspx:18   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +48   System.Web.UI.Control.OnLoad(EventArgs e) +133   System.Web.UI.Control.LoadRecursive() +66   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2604

طبعا عشان المثال ده بشتغل طبعا لازم تدخل على IIS وتضغط على اسم الـ Right Click - Folder وتختار Convert to Application

وبحثت كثيرا احتى نفذ صبرى ولم اصل لحل سواء فى المراجع او فى المنتديات سواء العربية او الاجنبية اكيد انا ناسى معلومة تافهة انا عارف لما الشىء يتنح قصادى كدة

يكون تافه لازم يذلنى لحد ما اعرفه

ييا جماعة ارجوكم المساعدة

مواضيع مشابهة