Notes on EXCEL operations in ASP.net

Source: Internet
Author: User
These days are depressing. Only one day. To complete an EXCEL report in any form in the asp.net Environment
Issued. Upload. Statistics.
I have never written office programs before. MSDN is still in February. No way. You have to watch it.
X: \ Program Files \ Microsoft Visual Studio. NET
2003 \ SDK \ v1.1 \ Samples \ Technologies \ Interop \ Applications \ Office \ Excel
DEMO.
I use OFFICE2003.
As stated in the SDK
Set ExcelTlb = D: \ Program Files \ Microsoft Office \ Office11 \ excel.exe
Then
Nmake D: \ Program Files \ Microsoft Visual Studio. NET
2003 \ SDK \ v1.1 \ Samples \ Technologies \ Interop \ Applications \ Office \ Excel \ makefil
E
OK
Winform runs normally. For the code, see. AutoExcel. cs
But the same code is thrown into asp.net.
First sentence
Application app = new Application ();
An error was reported. :(
Follow the first prompt: Add AutoExcel. cs to web. config.
<Identity impersonate = "true"/>
Then F5 :). OK. The first sentence is acceptable. However
System. Runtime. InteropServices. COMException: Server exceptions
This is terrible.
I tried it for half a day. No results. No way.
I found another gun and wrote a COM script. The result winform is easy to use. But webform is still the same. Depressing
Home now.

I reviewed GOOGLE and finally found the ultimate solution.

"Configure Dcom. Run dcomcnfg.exe, find the Excel application, configure its attributes, and select the authentication level"
"None", select "Interactive User" as the ID, and access the security page.
Everyone ."

This story is really useful to my wife and wife. Once the configuration is complete. Haha. Yes.
Otherwise, the source code cannot run :(

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.