About calling Office COM components to export Excel

Source: Internet
Author: User

Server environment:

The environment for the win2008 R2 system is 64 bits, and the program is a C # WinForm. Because the data needs to be processed, and the final generation of Excel, it takes too long to use multithreading. The WinForm program is started by a scheduled task and runs every night.

Demand:

Daily need to generate a large number of Excel to the user, about 1w+ Excel needs to produce, the original use of Aspose.Cells.dll generated, but found that there is always a lot of Excel inexplicable not generated, nor error. It was later replaced with Office Excel, which solves the problem of generating Excel.

But the development environment is no problem, the server is not so.

The following are the problems encountered:

1. The server does not have Excel COM components

Workaround: Install Excel for Office.

2. Excel COM component not found, Microsoft Excel application

Resolution: 32-bit system input DCOMCNFG can be found

64-bit system input comexp.msc-32 can be found. Because the COM component of Excel is 32-bit.

3, the process of exporting Excel, the report:

1) Retrieving a component of the CLSID {00024500-0000-0000-c000-000000000046} in a COM class factory failed because of the following error: 80070005

2) Retrieving the component of the CLSID {00024500-0000-0000-c000-000000000046} in the COM class factory failed because of the following error: 8000401A

Resolution 1): 80070005, on-line lookup, found to be a permission issue for COM components that do not have Excel configured. The DCOM configuration needs to be configured. Specific as follows: (The configuration of the network I did not configure understand.) Finally, according to their own understanding of the match)

In the start-run, output the commands mentioned above. Locate this Excel component, and then click the Right button property.

In security, all the options are customized, then click Edit, enter the user name of the scheduled task, and open all read and write permissions. (I found that the user who started the EXCEL.EXE program is the user who is planning the task, so I think that the user is accessing the COM component) and then click on the identity, select the following user, enter the user name, password. Finally determined. 80070005 errors were resolved, but when the 80070005 error was resolved, the new error 8000401a was generated.        At present 1w+ Excel, when export only 2-4excel is error, the rest are correct. 2) 8000401a error has not been resolved, online has said to join the Everyone user can. Give it a try.

About calling Office COM components to export 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.