Unable to export excel

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hi all,
I got some problem in my code and wish you can give me some aid...
I write a web by VS2010, which used to export the data from database(local SQLEXPRESS) to excel. It works fine when I "Play" the program in VS2010; But once I copy all source to inetpubwwwroot, it return the following errors while I try to export to excel:

System.Runtime.InteropServices.COMException (0x800A03EC): Microsoft Excel cannot access the file C:Windowssystem32. 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. at Microsoft.Office.Interop.Excel._Workbook.SaveAs(Object Filename, Object FileFormat, Object Password, Object WriteResPassword, Object ReadOnlyRecommended, Object CreateBackup, XlSaveAsAccessMode
AccessMode, Object ConflictResolution, Object AddToMru, Object TextCodepage, Object TextVisualLayout, Object Local) at EDM._Default.ExportToExcel(String strFileName, String strEmailListID, String& strErrMsg) in C:UsersLOCALUSERDocumentsVisual Studio
2010ProjectsPROJECTNAMEFOLDERNAMEDefault.aspx.cs:line 351

I dont understand about:
1) Why after I copy all source to inetpubwwwroot and access the url by either "localhost/default.aspx" or "computername/default.aspx" but it still quote about "C:UsersLOCALUSERDocumentsVisual Studio 2010ProjectsPROJECTNAMEFOLDERNAMEDefault.aspx.cs:line
351"
2) I did search from google about this and found the following reference
http://jefferytay.wordpress.com/2010/12/03/system-runtime-interopservices-comexception-0x800a03ec-microsoft-office-excel-cannot-access-the-file/ http://jefferytay.wordpress.com/2010/12/03/system-runtime-interopservices-comexception-0x800a03ec-microsoft-office-excel-cannot-access-the-file/
I did try the setting as the reference state, but its not working and I feel confuse why it try to access "C:Windowssystem32".....
http://jefferytay.wordpress.com/2010/12/03/system-runtime-interopservices-comexception-0x800a03ec-microsoft-office-excel-cannot-access-the-file/
can anyone give me some advise and comment please?
http://jefferytay.wordpress.com/2010/12/03/system-runtime-interopservices-comexception-0x800a03ec-microsoft-office-excel-cannot-access-the-file/
Many thanks http://jefferytay.wordpress.com/2010/12/03/system-runtime-interopservices-comexception-0x800a03ec-microsoft-office-excel-cannot-access-the-file/

View the full article
 
Back
Top