View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.vsnet.vstools.office
onedaywhen onedaywhen is offline
external usenet poster
 
Posts: 459
Default calling C# code from excel

Your .NET assembly needs a COM interop wrapper and your Excel project
needs VBA wrapper functions to call the functions in your DLL.

--

"Peter Torr \(MS\)" wrote in message ...
"Jason" wrote in message
om...
I'm working on a prototype program and have run into a snag. I am
trying to call some C# code that I have written from within Excel and
can't figure out how to register my methods as macros or formulas
within the excel environment.


Hi Jason,

If you don't like the idea of going down the XLL approach that Geoff
suggested, you should (in theory) be able to do it by building a managed COM
Add-In, but I don't know how to expose the methods from the AddIn to Excel.
Just making them public doesn't seem to help.

Maybe the Excel programming group knows? [added]

Peter