HRESULT: 0x800A03EC on Worksheet.range

前端 未结 23 2150
Happy的楠姐
Happy的楠姐 2020-11-22 07:42

I am getting HRESULT: 0x800A03EC on Worksheet.range method. Number of rows are more than 70K. Office 2007.

Code:

Microsoft.Office.Interop.Excel.Range         


        
相关标签:
23条回答
  • 2020-11-22 08:27

    Just FYI, got the error trying to apply row style....

    wSheet.Rows(y).Style = System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.Red)
    
    0 讨论(0)
  • 2020-11-22 08:31

    I also faced the same issue, when I was developing a application which exports project contents into excel file.

    I could not found the resolution in forums for my problem, then I check the maximum capacity of excel and found below link which says

    "Worksheet size 1,048,576 rows by 16,384 columns" and this was the issue in my case, I was exporting more than that rows. Refer below link for details

    http://answers.microsoft.com/en-us/office/forum/office_2013_release-excel/with-excel-2013how-many-rows-will-this-contain/271264fb-3ab8-4c5b-aa0d-7095c5ac6108

    Regards Prashant Neve

    0 讨论(0)
  • 2020-11-22 08:33

    We were receiving the same. The exception was

    Stacktrace: 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 Text VisualLayout, Object Local)`

    with an inner exception of

    Exception from HRESULT: 0x800A03EC 2012-11-01 10:37:59`

    We were able to resolve the problem with information from this post, which I quote here for convenience...

    1. Login to the server as a administrator.
    2. Go to "Start" -> "Run" and enter "taskmgr"
    3. Go to the process tab in task manager and check "Show Processes from all users"
    4. If there are any "Excel.exe" entries on the list, right click on the entry and select "End Process"
    5. Close task manager.
    6. Go to "Start" -> "Run" and enter "services.msc"
    7. Stop the service automating Excel if it is running.
    8. Go to "Start" -> "Run" and enter "dcomcnfg"
    9. This will bring up the component services window, expand out "Console Root" -> "Computers" -> "DCOM Config"
    10. Find "Microsoft Excel Application" in the list of components.
    11. Right click on the entry and select "Properties"
    12. Go to the "Identity" tab on the properties dialog.
    13. Select "The interactive user."
    14. Click the "OK" button.
    15. Switch to the services console
    16. Start the service automating Excel
    17. Test you application again.
    0 讨论(0)
  • 2020-11-22 08:33

    This isn't directly answering the question, but I was getting this error when opening an xlsx file. The problem was that I was using forward slashes in my file path. See also https://stackoverflow.com/a/24635904/5932003. It used to work in previous versions of Excel, but not with Version 1711 (Build 8730.2127).

    I was able to diagnose the problem using IDispatch->Invoke(..., EXCEPINFO, ...). The EXCEPINFO object contained a useful description of what went wrong. I was in C++ land, but I suspect that C# code similar to this SO post will do the trick: Packaging IDispatch Invoke with Parameters in C# (with DISPPARAMS).

    0 讨论(0)
  • 2020-11-22 08:34

    Simply, the excel file is corrupt. Best solution is change/repair the file.(make a copy of the existing file and rename it)

    0 讨论(0)
提交回复
热议问题