Unhandled exception of type "System.Runtime.InteropServices.COMException" in mscorlib.dll

Additional information: Exception from HRESULT: 0x800AC472

// вывод имени таблицы sheet.get_Range("A1:D2").MergeCells = true; sheet.Range["A1"].Value = "Ведомость"; 

It gives an error and does not open the Excel document.

    1 answer 1

    Perhaps you need to add Local Activation rights for the asp_net account.

    1. Open Component Services
    2. Expand DCOM tree
    3. Find Excel Document
    4. Right click on the element, select properties
    5. Go to the Security tab, select Customize-> Edit
    6. Choose an asp_net account and set the Local Activation flag for it.

    The link below provides an example for solving problems with a Microsoft Word document. http://www.vbforums.com/showthread.php?657928-failed-due-to-the-following-error-80070005-Access-is-denied .

    I give a screenshot of the example from the source Screenshot from the source

    • one
      Give a more detailed answer. One link is not enough to answer. - 0xdb