Frequently asked questions in IIS using Microsoft.Office.Interop.Excel

Source: Internet
Author: User

Using Microsoft.Office.Interop.Excel in IIS

Exception 1:

Failed to retrieve a component of the CLSID {00024500-0000-0000-c000-000000000046} in a COM class factory because of the following error: 80080005.

Solution:

A. Check that the user groups on the IIS published Web site have administrators user rights

B, configure the COM component, open the Command Run window with the Win+r command, enter the DCOMCNFG command, enter the Component Services Configuration interface, locate "Microsoft Excel Application", configure "Security" and "identity":

All three should be customized and configured as everyone, as follows:

Configure identity, select the following user, configure as Administrator user, password is the user's login password:

Exception 2:

The RPC server is not available. (Exception from HRESULT:0X800706BA)

Solution:

The following code does not throw an exception in some versions of the Windows system:

Excel.Application Excleapp =NewExcel.Application (); Excel.Workbook Workbook=ExcleApp.Workbooks.Open (Reportfilepath); Try            {
//... } Catch(Exception ex) {Throw NewException (ex. Message); } finally{workbook. Save (); //Resource CleanupExcleapp.quit (); System.Runtime.InteropServices.Marshal.ReleaseComObject (workbook); System.Runtime.InteropServices.Marshal.ReleaseComObject (Excleapp); Gc. Collect (); }

But some versions

Frequently asked questions in IIS using Microsoft.Office.Interop.Excel

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.