Question

I am creating a C# program that outputs data to excel using Microsoft.Office.Interop.Excel Namespace

In excel I have 5 user defined functions (UDF) that when executed I will like to call a method on my C# application. The way I am planing on trigering a method on C# is on excel I will write to a file named someFile.txt I will write 1 to it. Then on my C# application I will read that 1 and because I read a 1 I will trigger method 1 for instance. One process (excel) will write to the file and the other process (c# program) will read from that file. In other words https://stackoverflow.com/a/222111/637142.

I know it will be more appropiate to create an XLL, or used named pipes. The problem is I know very little visual basic and I believe writing one byte to a file (1,2,3,4 or 5) should be very quick. So using this implementation is a bad idea?

Was it helpful?

Solution

You can call a WebService inside Excel see this post

In your C# application you can write a simple basic WCF see this example

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top