Creating an XLL with C#

  • Thread starter Thread starter Jon Anderson
  • Start date Start date
I was wondering if anyone knows how to create an XLL using C#. Cananyone help me create a simular solution with an XLL?

Try Excel4Net 2.0 - a RAD kit for creating Excel spreadsheet applications, add-ins, XLL-s and UDFs using the .NET framework:

Key features:

*Easy to use
*Very fast + has a built-in monitoring and performance profiling capabilities
*Automatically marshals and converts input and output data
*Works with VBA and with in-cell functions
*Uses a simple deployment model
*Makes it easy to test and debug your spreadsheet and .NET code
*Supports users remotely
*Generates user documentation "on-the-fly"
*Runs on Excel 2002, 2003 and 2007, .NET 2.0, 3.0 and 3.5

"Quick overview" page: http://excel4net.com/Overview.aspx
Download link: http://excel4net.com/Download.aspx
 
Last edited:
I have been asked to work on building a small analytics library for a small prop trading firm. We are an Excel-phile firm and will be creating the library as an Excel XLL addin.
At a previous employer we used to use xlw, its a free library to build xlls. Recently I have heard that xlw can now be used to write xlls in C#, but I cannot find it anywhere.
Has anybody have any idea where I can get it from ? or even if it exists ?


Regards
"Happy to be in work again" Sunny :-)
 
XLW v4 RELEASED.



XLW is an open source application that wraps the Excel C API in simple C++, C# or VB.NET interfaces which you can use to customize Excel with your own worksheet functions and menu items.

XLW developers include Financial Engineering practitioners with extensive experience of developing quantitative analytics in the finance industry including Mark Joshi the author of The Concepts and Practice of Mathematical Finance and C++ Design Patterns and Derivatives Pricing.

The project's interface generation system seamlessly parses your C++ header files ...
Code:
 // Test.h
               
               #ifndef TEST_H
               #define TEST_H
              
               //
               
               std::wstring // Concatenate two strings
               //
               Concat(std::wstring str1,  // First string
                      std::wstring str2); // Second string
               
               double // Compute the circumference of a circle
               //
               Circ(double Diameter); // The circle's diameter
               
               #endif
... and your C# ...
Code:
      namespace Example
        {
          public class Class1
           {
            [ExcelExport("computes the circumference of a circle ")]
            public static double Circ(
                [Parameter("the circle's diameter")] double Diameter)
                {
                    return Diameter * 3.14159;
                }
        
            [ExcelExport("Concatenates two strings")]
            public static string Concat(
                [Parameter("first string")] string str1,
                [Parameter("second string")] string str2)
                {
                    return str1+str2;
                }
        
            }
        }

...to automatically generate the corresponding XLW Excel addin (xll).

screenshot.jpg



XLW supports :
  • new features introduced by Excel 2007 such as multithreaded worksheet formulas, larger spreadsheets, and Unicode strings.
  • the ability to implement Excel Addin worksheet functions in C# and VB.NET in addition to C++.
  • new installer to make it even easier to install and create template projects to get you started.
See the Youtube video clips demonstrating the ease with which Excel XLLs can be created.

Visit XLW



 
Last edited:
Back
Top