Workaround for exporting Excel "exception from HRESULT:0X800A03EC" error (verified)It's hard to find an error that resolves the export data to Excel where "exception from Hresult:0x800a03ec" occurs.Searching for solutions from Google, the online solution basically says that the starting line's subscript value is written in the 0 resulting "Excel." Cells[0, 1] = "1th row 1th column"; ", instead of more than
Xlbook.saveas (Filepath,microsoft.office.interop.excel.xlfileformat.xlexcel8, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Excel.XlSaveAsAccessMode.xlNoChange, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);found that the OFFICE.INTEROP.EXCEL.XLFILEFORMAT.XLEXCEL8 format is not the same as the native installed Office, with Office.Interop.Excel.XlFileFormat.xlWorkbookNormal you canXlbook.saveas (FilePath, Microsoft.Office.Interop.Excel.XlFileFormat.xlWorkbookNorm
An error occurred while calling Excel to operate the Excel file in the service program.
Event Type: ErrorEvent Source: Report Service MMSEvent Type: NoneEvent ID: 110Date: 2006-9-7Event: 11:21:35User: N/COMPUTER: NMC19Description:An error occurred while opening an Excel Report using the Excel component.System. Runtime. InteropServices. COMException (0x800A03EC): the file cannot be read.At Microsoft. office. interop. excel. workbooks. open (St
After DCOM configures the excel permission, ASP. NET fails to generate an excel file (the exception is HRESULT: 0x800A03EC ),
I found a lot of information on the network speed and did not solve it effectively. Finally, I changed the "SaveAs" method to "SaveCopyAs.
For example:
'Workbook. SaveAs (Server. MapPath (".../../DownLoadFile/" + newFileName) 'is saved first
Workbook. SaveCopyAs (Server. MapPath (".../../DownLoadFile/" + newFileName ))
To run the 32-bit version of ASP. NET 2.0,
1. Click Start, click Run, type cmd, and click OK ".
2. type the following command to enable the 32-Bit mode:
Cscript % systemdrive % \ Inetpub \ adminscripts \ adsutil. vbs set
Reposted from: summary of the history of a difficult ASP. NET Excel file generation by Xuan soul's blog
The last task of the statistics system is to export data to Excel. as it was the first time, I learned and made a great deal of effort. After that, I made a summary.
The development environment is as follows:
Operating System: Windows 7
Development Tool: vs2010
. NET: 4.0
Server System: Windows2003
Office version: 2003
The main problems involved in this article:
1) how to generate an Excel fi
System. runtime. interopservices. comexception (0x800a03ec): Microsoft Office Excel cannot access the file "D: \ Benz \ Daimler \ benz. Win \ lshbizplanfigure.xls ". Possible causes include:
? The file name or path does not exist.? File is beingProgram.? The workbook you want to save has the same name as the one currently opened.
I am very puzzled when this problem occurs.
The solution is also very confusing.
This solution is...
? Wind
ASP. NET calls the Excel Process
The common solution to the problem that the Excel process cannot end in ASP. NET calling is the following code.
wb.Close(null,null,null);
app.Workbooks.Close();
app.Quit();
if(rng!=null)
{
System.Runtime.InteropServices.Marshal.ReleaseComObject(rng);
rng=null;
}
if(ws!=null)
{
System.Runtime.InteropServices.Marshal.ReleaseComObject(ws);
ws=null;
}
if(wb!=null)
{System.Runtime.InteropServices.Marshal.ReleaseComObje
the problem persists, because calling office operations may involve other system resources and may still cause problems due to insufficient permissions, after setting the Excel application, the system may still report a 80070005 error. The most safe thing is to select my computer in dcomcnfg and then right-click Properties> com security to grant the access permission, all the start and activation permissions are edited by default. Add network service (Asp.net user is required for IIS 5.0) to it
) {return; } Workbooks Workbooks = Xlapp.workbooks; Workbook Workbook = workbooks. ADD (Xlwbatemplate.xlwbatworksheet); Worksheet Worksheet = (Worksheet) workbook. worksheets[1];//gets sheet1 long rows = table. Rows.Count; /* Two lines of code below the comment when the number of rows exceeds the row, an exception occurs: Exception is from HRESULT:0X800A03EC. Because: Excel 2003 supports only the maximum row data per sheet//range FCHR =
Two exceptions occurred during Excel export today:
"Hresult: 0x800a03ec"
There are many causes for this exception. The problem I encountered was that a naming error in the table area resulted in Microsoft. office. interOP. excel. range namerange = oworksheet. get_range (cellname, type. the name cannot be found, and an error occurs. Name of the region corresponding to the Change number
"The select method of the range class is invalid"
The cause o
permissions on the appropriate Microsoft application components, otherwise it will not be able to access the appropriate application; The components used in this session are Microsoft Excel application;Error: System.Runtime.InteropServices.COMException (0x80080005): Retrieving the CLSID in the COM class factory is {00024500-0000-0000- The component of c000-000000000046} failed,The following error occurred because the 80080005 server failed to run (Exception from hresult:0x80080005 (Co_e_server_
System.Runtime.InteropServices.COMException (0X800A03EC): Microsoft Office Excel cannot access files "D:\Benz\Daimler\Benz.Win\ Lshbizplanfigure.xls ". Possible causes are:
? 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 the workbook that is currently open.
I was puzzled by the appearance of the problem.
And the solution is very confusing.
This solution is
C # the main method for exporting Excel is as follows:Code:Public void CellToCell (DataSet ds){# Region required objects for instantiation// Instantiate an Excel Document ObjectMicrosoft. Office. Interop. Excel. Application exapp = new Microsoft. Office. Interop. Excel. Application ();// Set visible// If the value is false, the Excel document cannot be viewed.Exapp. Visible = true;// Set the workbook formatMicrosoft. Office. Interop. Excel. Workbook myworkbook = exapp. Workbooks. Add (Microsoft.
; Microsoft.Office.Interop.Excel.Workbook Xlbook= XLAPP.WORKBOOKS.ADD (true); //Import the column name of the ListView into the first row of the Excel table foreach(ColumnHeader DCinchlistview.columns) {columnindex++; Xlapp.cells[rowindex, ColumnIndex]=DC. Text; } //import data from a ListView into Excel for(inti =0; i ) {RowIndex++; ColumnIndex=0; for(intj =0; J ) {columnindex++; //Note that the purpose of adding "\ t" when exporting
the cause of the exception and where it occurred. Stack trace:[COMException (0X800A03EC): Microsoft Office Excel cannot access the file "". The possible causes are:? 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 the currently open workbook. ]MICROSOFT.OFFICE.INTEROP.EXCEL.WORKBOOKS.ADD (Object Template) +0Kobelco. WebUI.Quote5.OutputExcel (String Lblmachinem
. Please do not forget to save the exported file! ");Exapp. Caption = "Excel Demo test file ";}
Note:
Match the referenced DLL version with the Office version installed on the client
"Exception from HRESULT: 0x800A03EC" may be caused by the cell index problem. The first cell in Excel is instead.
Reference website
Http://support.microsoft.com/kb/306023/zh-cn
Http://www.cnblogs.com/jinliangliu/archive/2006/08/18/480391.html
Http://www.cnblogs.c
that have never been used before. Such as querying all the database names on the server.
Interested in: http://www.cnblogs.com/eter/archive/2011/08/15/2139063.html
Import to excel
///
Some problems encountered during the test are also interesting.
Question 1:
When reading an Excel file, the error "exception in HRESULT: 0X800A03EC" is displayed ".
After reading MSDN, Microsoft's colleagues told me this. That is, every time I add too much content
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.