Unable to cast COM with type Excel.applicationclass to the interface type resolution [go]

Source: Internet
Author: User
<span id="Label3"></p>C # Solution Excel Export<p><p><span style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;">today, The Client's computer was prompted to export excel, unable to cast COM with type Excel.applicationclass to the interface type excel._application problem</span></p></p><p><p><span style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;">finally, the following method to solve, the most important thing is this sentence:<span style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;"> "C:\Program Files\Microsoft Office\office11\excel.exe"/regserver</span></span></p></p><p><p><span style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;"><span style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;">Customer's computer failure is originally exported to normal, and then suddenly can not be exported, after the accident is due to the installation of wps, resulting in the corresponding component Conflicts.</span></span></p></p><p><p><span style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;"><span style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;">The intermediate process is to uninstall wps, then reinstall the OFFICE2003, the problem will not be resolved, and finally the above command re-register the Excel component, the problem is Resolved.</span></span></p></p><p><p></p></p><p><p><span style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;">This is exactly what I have encountered, and it seems that many people have encountered this Problem.</span></p></p><span style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;">In fact, this is mostly the server does not have Office installed, or installed but not the relevant permissions. give you a reference Solution.<br style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;"><br style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;"><span style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;">I. If you are using Office components for Excel export, you must have the corresponding version of Office installed on the server (such as the Office2003 you are developing, the server will need to install Office2003, of course, if you only export excel, you only have to install Office Excel), Office is not installed without the ability to export.<br style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;"><span style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;">Two. a failure occurred with a component similar to "error code: retrieving the CLSID {00024500-0000-0000-c000-000000000046} in a COM class factory" because of the following error: 80070005. "error, The reason is basically due to insufficient permissions, the general resolution steps are as Follows: (the following solution applies to winxp,2003,2008, including 64-bit systems, I am using the version of Office 2003)<br style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;"><span style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;">1: Enter Dcomcnfg.exe in start, run, start Component Services<br style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;"><span style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;">2: Double-click "computer", "component services", "my computer", "dcom configuration"<br style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;"><span style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;">3: locate "microsoft Excel application" in "dcom config", right-click on it, and then click "properties" to eject "microsoft Excel should<br style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;"><span style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;">Using the Program Properties dialog box<br style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;"><span style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;">Special note: in the win2008 64-bit system, The default is not to see the "Microsoft Excel application" item, you need to first start, run<br style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;"><span style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;">Enter "mmc-32″ (do not Quote) enter, in the popup window,<br style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;"><span style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;">A. In the first menu (File), select Add/remove Components (add/remove Snap)<br style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;"><span style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;">B. Adding a component service (Component services)<br style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;"><span style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;">C. You can then find the "Microsoft Excel application" item under Component Services (Component Service)<br style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;"><span style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;">D. Subsequent operations with the 32-bit operating system<br style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;"><span style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;">4: Click on the "logo" tab and select "interactive user"<br style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;"><span style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;">5: Click on the "security" tab, click "customize" on "launch and activation rights", then click on the corresponding "edit" button to add the "security" dialog box.<br style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;"><span style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;">A "NETWORK SERVICE" user (note to select the computer Name) and give it the "local launch" and "local activation" permissions.<br style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;"><span style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;">6: remain the "security" tab, click "customize" on "access", then click "edit" and Add a "NETWORK" in the "security" dialog box that pops up.<br style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;"><span style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;">SERVICE user, and then give the local access Permission.<br style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;"><span style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;">This allows us to configure DCOM permissions for the corresponding excel.<br style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;"><span style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;">Note: this is configured on WIN2003, on 2000,xp, is to configure the ASPNET user<br style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;"><span style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;">Generally through the above steps can solve the problem, of course, if your problem has not been resolved, you can refer to the following information:<br style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;"><span style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;">1) Check your Web. config for <identity impersonate= "true"/> this entry, if any, delete<br style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;"><span style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;">The purpose of this passage is to perform a client-side simulation for each request, as explained in the prompt message, since there is no setting username,<br style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;"><span style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;">So the currently executing user is iusr_machinename, and the user is not authorized to manipulate the Excel component<br style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;"><span style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;">If you need to add permissions for the specified user, you can<br style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;"><span style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;"><identity impersonate= "true" username= "login name" password= "password"/><br style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;"><span style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;">2) if the interactive user set up error 8000401a, you can cancel the interactive user, designated as administratr, can temporarily resolve the Issue.<br style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;"><span style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;">Note: When you use the above settings, you may see "cannot use object references or links" when you open excel, and you cannot paste Cells.<br style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;"><span style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;">The cause is unknown, and it disappears after you cancel the Setting.<br style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;"><span style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;">3) If you have multiple versions of Office at the same time, make sure which version of Excel is open by default, and if so, re-register as follows<br style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;"><span style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;">Start-to-run installation path, input excel2003 (2007 similar),<br style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;"><span style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;">For example "C:\Program Files\Microsoft Office\office11\excel.exe"/regserver<br style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;"><span style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;">Note/symbol preceded by a space, where "C:\Program files\microsoft office\office11\excel.exe"<br style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;"><span style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;">is the path of the excel2003 installer, and the parameter regserver indicates the meaning of the registration<br style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;"><span style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;">4) if the "cannot set Orientation property of class pagesetup" error occurs, Check if the printer is installed on the server, if there is no<br style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;"><span style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;"><span style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;">Please install one (can be a virtual printer, local)<br style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;"><span style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;">5) for 64-bit Systems If you still have a problem, try<br style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;"><span style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;">Create a desktop folder under C:\Windows\SysWOW64\config\systemprofile\<br style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;"><span style="color: #333333; line-height: 24px; font-family: Helvetica,Tahoma,Arial,sans-serif; font-size: 14px;">then, try to elevate the app pool permissions.</span> </span> </span> </span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><p><p>Unable to cast COM with type Excel.applicationclass to the interface type resolution [go]</p></p></span>

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.