Questions tagged [interop]

Interoperability is a requirement for one computer system or programming language to work with another.

Interoperability is a requirement for one computer system or programming language to work with another.

A number of computer systems, especially Microsoft's .NET Framework, reduce this term to Interop.

5522 questions
44
votes
8 answers

Microsoft.Office.Interop.Excel really slow

I am exporting a 1200 X 800 matrix (indexMatrix) to a excel file using the standard Microsoft.Office.Interop.Excel. The app works, just that it is really really really slow( even for the 100 x 100 matrix) . I also export in a text file through a…
Alex
  • 9,669
  • 27
  • 87
  • 161
44
votes
9 answers

How do you call Python code from C code?

I want to extend a large C project with some new functionality, but I really want to write it in Python. Basically, I want to call Python code from C code. However, Python->C wrappers like SWIG allow for the OPPOSITE, that is writing C modules and…
pgb
  • 488
  • 1
  • 4
  • 9
41
votes
6 answers

Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE))

I am trying to convert a .xls file to an .xlsx file on the server-side using Microsoft.Office.Interop.Excel.Workbook class as follows: workBook.SaveAs("FILENAME_HERE", XlFileFormat.xlOpenXMLWorkbook, Type.Missing, Type.Missing, Type.Missing,…
Tamas Ionut
  • 3,932
  • 5
  • 31
  • 57
41
votes
4 answers

A Simple C# DLL - how do I call it from Excel, Access, VBA, VB6?

I have a simple class library written in c#. using System; namespace TestDll { public class Test { public string HelloWorld { get { return "Hello World"; } } …
divinci
  • 20,239
  • 11
  • 42
  • 56
40
votes
8 answers

Disposing of Microsoft.Office.Interop.Word.Application

(Somewhat of a follow on from the post (which remains unanswered): https://stackoverflow.com/q/6197829/314661) Using the following code Application app = new Application(); _Document doc = app.Documents.Open("myDocPath.docx", false, false,…
Maxim Gershkovich
  • 42,124
  • 39
  • 134
  • 227
38
votes
6 answers

Add offset to IntPtr

I'm looking for a way to perform pointer operations in C# or .NET in particular. I want to do something very simple Having a pointer IntPtr I want to get IntPtr object which points to 2 bytes ahead. I read some post that the foolowing snippet will…
Marcin Rybacki
  • 934
  • 1
  • 9
  • 18
37
votes
6 answers

Handling Null Values in F#

I need to interop with some C# code with F#. Null is a possible value that it is given so I need to check if the value was null. The docs suggest using pattern matching as such: match value with | null -> ... | _ -> ... The problem I'm having is…
Jonathan Sternberg
  • 5,796
  • 6
  • 33
  • 57
37
votes
3 answers

Using Kotlin class in Java: Cannot find symbol

I have found this similar question regarding Android, but I am using plain Java with Maven as build tool. I think it is better to post a new question. I have created a Kotlin class to which I am trying to refer from Java class as…
Vojtěch
  • 9,438
  • 25
  • 81
  • 138
37
votes
2 answers

Clean up Excel Interop Objects with IDisposable

In my company the common way to release Excel Interop Objects is to use IDisposable the following way: Public Sub Dispose() Implements IDisposable.Dispose If Not bolDisposed Then Finalize() System.GC.SuppressFinalize(Me) End…
ruedi
  • 4,417
  • 11
  • 41
  • 73
35
votes
9 answers

Referencing Google's V8 engine from a .NET app

I'm building a .NET 3.5 application and have the need to evaluate JS code on the server - basically a user provided rule set that can work within a browser or on the server. Managed JS is not an option, because the JS code would be provided at…
NathanD
  • 7,611
  • 7
  • 28
  • 26
35
votes
1 answer

Why use FinalReleaseComObject instead of ReleaseComObject?

I know the basic difference as ReleaseComObject only decreases some counter by one and FinalReleaseComObject decreases it to zero. So what I usually hear is, call FinalReleaseComObject because then you are sure that the COM object is really…
Matthijs Wessels
  • 6,234
  • 6
  • 54
  • 97
34
votes
5 answers

Call R (programming language) from .net

I'm working on an application that requires a great deal of stastical processing and output as images in a .net desktop application. The problems, including generating the output images, seem like a natural fit for R http://www.r-project.org/ Is…
detroitpro
  • 3,743
  • 4
  • 33
  • 63
34
votes
1 answer

Is C NULL equal to C++11 nullptr

I like to use nullptr instead of NULL. Now I call a C function (from libjansson in this case). NULL in C is implementation defined. For nullptr I found that "A null pointer constant is an integral constant expression (5.19) rvalue of integer type…
user877329
  • 5,419
  • 7
  • 34
  • 73
33
votes
3 answers

Java <-> Scala interop: transparent List and Map conversion

I am learning Scala and I have a Java project to migrate to Scala. I want to migrate it by rewriting classes one-by-one and checking that new class didn't break the project. This Java project uses lots of java.util.List and java.util.Map. In new…
oshyshko
  • 2,009
  • 2
  • 20
  • 31
33
votes
4 answers

Excel Interop - Add a new worksheet after all of the others

I am trying to add a new worksheet to an Excel workbook and make this the last worksheet in the book in C# Excel Interop. It seems really simple, and I thought the below code would do it: using System.Runtime.InteropServices; using Excel =…
JMK
  • 24,985
  • 50
  • 147
  • 268