The interoperability type "Microsoft. Office. InterOP. Excel. applicationclass" cannot be embedded ". Use the applicable interface instead.
When exporting the datagridview in winform, write the following statement:Microsoft. Office. InterOP. Excel. Application xlapp = new Microsoft. Office. InterOP. Excel. applicationclass ();
The result is as follows:
Type: M
The following uses the vs2008 development environment as an example:----------------------------------------------------------------------Step 1: Convert the COM interface to a. net interface
Before using mapwingis. ocx in the. NET language, you must convert the COM interface to the. NET interface,ProgramAccess the specific implementation functions in COM through the. NET interface.
Method (1) When mapwingis. ocx is added to the. NET project, a file named
Example5.cs source file (for example, the C:\CSOfficeSamples directory) and type csc/r after the command prompt : "C:\Office XP pias\ Microsoft.Office.Interop.Word.dll "/r: C:\Office XP pias\office.dll" Example5.cs.(If the Office XP PIA is saved in a different location, you will need to replace the following drive and installation paths with the corresponding values:csc/r: Drive:\. )
To run Example5.exe (located in the same folder as the Example5.cs source file), double-click the program.
Development Guide:
1. The office. NET development kit must be installed.
2. Add the COM component: Microsoft Word 11.0 Object Library in the project reference.
1 // The printed code is as follows:
2 Microsoft. Office. InterOP. Word. Application APP = NULL;
3 Microsoft. Office. InterOP. Word. Document Doc = NULL;
4 object missing = system. reflection. Missing. value;
5 object templatefile = application.
Personal Project Practice, feasible
Asp.net C # export Excel
/// /// Al: columnname of the record set to be printed: Display name of the header/// Public static void outtoexcel (arraylist Al, string [] columnname ){
Microsoft. Office. InterOP. Excel. Application Excel = new Microsoft. Office. InterOP. Excel. Application ();Microsoft. Office. InterOP. Excel. Work
simulation in config, in The above is only a theoretical solution. In actual testing, there are still various problems, such as the closure of word conversion and the deletion of intermediate documents. The implementation method is as follows:1: In the web. use identity simulation in config, in 2: install Adobe Acrobat Professional 7.0 and its cracking (the uncracked version can only be used for 30 days ).3. Install a virtual printer: Go to the control panel of WINDOWS, enter the printer, click
software compatible with Windows 2000 and later (see smart transmission in the background ).
All the features in BITs 1.0 are sufficient for writing automatic update applications, but the bits 1.5 feature can be used to execute more complex tasks, such as selling updates or processing interactions between applications and servers.Back to Top
BITs, COM, and managed code
Bits APIs are implemented as COM objects. Therefore, you cannot compile APIs of the. NET Framework version. Fortunately, BITs A
C # Use Word to print the code. The specific implementation code is as follows:
Datetime dt = datetime. now;Object none = system. reflection. Missing. value;Microsoft. Office. InterOP. Word. Application wordapp = new Microsoft. Office. InterOP. Word. Application ();Microsoft. Office. InterOP. Word. Document document = wordapp. Documents. Add (ref none, ref none )
always released with. net. However, in recent years, the release version of. net has been from 2.0 to 3.5, but the CLR has remained at 2.0, as shown in the following table:
. NetFramework Version
Time
CLR
1.0
2002.2
1.0
1.1
2003.4
1.1
2.0 (generics)
2006.1
2.0
3.0 (WPF/WCF/WF)
2006.11
2.0
3.5 (LINQ)
2007.11
2.0
4.0 Beta
2009.5
4.0
Figure 2 CLR
application, the question often arises, "is your application 100 percent. Net? "Or," how much of your application is. Net? "There is an implied qualitative judgment behind these questions, and it's usually pejorative.
I 've heard it said by using a CTO in using a technical briefing that, "we're planning to port our whole system. net. "Why spend 18 months converting your application, so you can arrive at the endpoint you're already?
The implication is that an application entirely written in.
There are many ways to export data in the datagridview to excel. The common method is to use the office COM component to copy the data in the datagridview to the Excel Cell Object cyclically, and then save the entire Excel Workbook. However, if the data volume is too large, such as tens of thousands of rows of data or multiple Excel sheet needs to be exported at the same time, the efficiency will be relatively low. You can try asynchronous operations or multithreading to solve the problem of UI
Recently, in a project, the customer requested to display the content in the generated RTF file by page. As he had no idea about this, he also found relevant information on the Internet, in addition, I used my own search on msdn to solve the problem. The following is a simple summary of C # Word documents (encryption, decryption, and pagination). I hope to help some friends. Pai_^
Before writing code, you need to reference the corresponding DLL file:
1. Inte
According to a comment in the mdsn article about tlbimp for 2.0, you can't fix this problem w/o running tlbimp yourself.
It was easy to reproduce your problem using vs. I also reproduced it running tlbimp manually from a vs comment prompt:
Tlbimp c: \ winnt \ system32 \ activeds. TLB/out: InterOP. activeds. dllthe fix was to use the/silent Switch
Tlbimp c: \ winnt \ system32 \ activeds. TLB/silent/out: Inter
After searching the Internet for half a day, there is no straightforward method, either it is slow or it is terrible slow. by thinking about it, you can finally get the structure of the Word document quickly. Take a shower, (* ^__^ *), and you will see it .......
[Csharp]Private void barButtonItem24_ItemClick (object sender, DevExpress. XtraBars. ItemClickEventArgs e){Microsoft. Office. Interop. Word. Document doc = (Microsoft. Office.
Navisworks provides three APIs for. NET, COM, and nwcreate. And usually we say that the Navisworks API actually refers to COM or. NET, because the Nwcreate function is more special. Wait for me one by one way:
COM API: This is an interface that was provided long ago. How old COM is, and how old it is. It can do most of the features in the product.
. NET API: This is provided at the beginning of the 2011 release. Used to gradually replace the COM API. But not simply to move COM funct
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.