Excel-DNA

.NET for Applications

ExcelDna

  • Introduction
  • Getting Started
  • Some More Examples
Subscribe to this blog's feed

Excel-DNA version 0.29

Excel-DNA version 0.29 is now available on the CodePlex site: http://exceldna.codeplex.com.

The new home for Excel-DNA as at http://excel-dna.net, and the primary support channel remains the Google group at http://groups.google.com/group/exceldna.

Version 0.29 adds support for a number of specialized Excel features. The 64-bit version of Excel 2010 is fully supported, registration-free Custom Task Panes can be created under Excel 2007 and later, direct COM server integration can improve integration with legacy VBA code, and macros with parameters are registered. In addition, there are some features to improve the development and debugging workflow, and a few minor bugfixes. The complete change list is included below. 

More information about the new features will be posted on the Excel-DNA website - http://www.excel-dna.net - in the coming months. Any comments or questions are welcome on the Google group - http://groups.google.com/group/exceldna - or by contacting me directly. 

As always, I greatly appreciate any feedback on this version, and on Excel-DNA in general. 

Govert 

Complete change list 

  • BREAKING CHANGE! Changed SheetId in the ExcelReference type to an IntPtr for 64-bit compatibility.
  • Changed initialization - only create sandboxed AppDomain under .NET 4 (or if explicitly requested with CreateSandboxedAppDomain='true' attribute on DnaLibrary tag in .dna file). 
  • Fixed memory leak when getting SheetId for ExcelReference parameters. 
  • Fixed Ribbon RunTagMacro when no Workbook open. 
  • Fixed Missing/Empty marshaling in XlCall.Excel calls under Excel 2003 and below.
  • Added support for the 64-bit version of Excel 2010 with the .Net 4 runtime. 
  • Added Cluster-safe function support for Excel 2010 HPC Cluster Connector - mark functions as IsClusterSafe=true. 
  • Added CustomTaskPane support and sample. 
  • Added COM server support for RTD servers and other ComVisible classes. Mark ExternalLibraries and Projects as ComServer="true" in the .dna file. Supports Regsvr32 registration or by calling ComServer.DllRegisterServer. Allows direct RTD and VBA object instantiation. Includes TypeLib registration and packing support. 
  • Added support for macros with parameters. 
  • Added ArrayResizer sample. 
  • Added C# 4 dynamic type sample. 
  • Added Path attribute to SourceItem tag to allow external source. 
  • Added LoadFromBytes attribute to ExternalLibrary tag to prevent locking of .dll. 
  • Added /O output path option to ExcelDnaPack. 
  • Added 'before' option to CommandBars xml. 
  • Added Int64 support for parameters and return values.

07 June 2011 | Permalink

Excel-Dna version 0.28

I've put together a new release of Excel-Dna.

Excel-Dna version 0.28 consolidates recent bugfixes and updates to the Excel-Dna Runtime. Although I've marked two items as breaking changes below, the Reference resolution change should not affect many users, and the Ribbon type namespace changes require only a change in namespace declaration when recompiling. Please test and check a bit if you are using the Ribbon support. For most users, this version should be a drop-in replacement that just works a bit better.

There is one significant improvement in this version that might ease the use and deployment in network scenarios (and make these possible under .NET 4). Excel-Dna now creates a FullTrust Sandboxed AppDomain for each add-in. While Excel-Dna has made a separate AppDomain per add-in for many years, the full trust sandbox means that Excel-Dna effectively opts out of the code-access security policy mechanism. Note that in .NET 4, the CAS policy has been deprecated completely, delegating all security setup to the runtime host. This means you don't have to fiddle with caspol to deploy Excel-Dna based add-ins on a network anymore, and with the ShadowCopyFiles feature which was added in the previous version, network-based deployment should be much easier than before.

The new release is available on the Excel-Dna CodePlex site as release 55014. 

As always, I greatly appreciate any feedback on this version, and on Excel-Dna in general. The main support forum remains the Excel-Dna Google group, but you are also welcome to contact me directly at govert@icon.co.za.

Govert


Complete list of changes:

  • BREAKING CHANGE! IRibbonUI, IRibbonControl etc. moved to ExcelDna.Integration.CustomUI namespace to avoid type name clash in external libs.
  • BREAKING CHANGE! Extended Reference path resolution for code in .dna files: XML Attribute Reference.AssemblyPath renamed to Reference.Path, Reference resolution first probes using Reference.Path,then LoadWithPartialName is called with Reference.Name.
  • Fixed xml namespace for Excel 2010 Ribbon.
  • ExcelRibbon objects only instantiated in Excel 2007 and later.
  • Explicitly create a FullTrust sandbox AppDomain for all add-ins. This makes loading of libraries over a network or http possible under .Net 4, and easier under .Net 2.0.
  • Added http://... support for loading ExternalLibraries.
  • Fixed packed image bug.
  • Fixed object[0] marshaling crash.
  • Changed LogDisplay to address freezing report.
  • Added check for <MyAddin>.xll in packer.
  • Added VS2008 solution and project files.
  • Somewhat better error handling when Assembly Load fails, e.g. ExternalLibrary failures.
  • Added ExcelCommandBarUtil to allow explicit load of command bars from xml string.
  • Made late-bound CommandBars API public - check Distribution\Samples\Ribbon\CommandBarsAllWays.dna.
  • Fixed non-zero-base array marshaling bug.

11 November 2010 | Permalink

Call for help with Documentation, Testing and Samples

Hi Excel-Dna users,

I'd like to extend a call for volunteers to help Excel-Dna with some 
of the grunt-work that often gets neglected with open-source projects. 

In particular, Excel-Dna could really use your help with: 

  1. Documentation. Particularly reference documentation for the library. This would include the schema for the .dna files, supported datatypes for registration, the ExcelFunction and ExcelCommand attributes, using the Ribbon, Command and RTD support. Instructions on getting everything set up in Visual Studio etc. So this is going beyond the Getting Started walkthrough, of which there are (thankfully) a few on the web already. 
  2. Testing. The Excel-Dna Runtime needs a testing framework, and lots of unit tests. I imagine something that would drive Excel, load an add-in and test whether a particular feature works. 
  3. Samples. We need both a library of small examples that use particular features, and a few comprehensive add-ins that show how a really polished add-in can be made with Excel-Dna, combining Ribbons and UDFs. 
  4. Testimonials and user stories. Are you using Excel-Dna successfully? I understand that many users would like to keep their magic under wraps, and that's fine. But I'd love to know a bit more about who uses Excel-Dna, how many users of your add-ins you have, and how it is used it or has helped your organisation. I'd want to put together these references and stories on the project site. Please indicate whether it is OK for me to post your story, if I can add a company logo, or whether I should keep it private (I'd still love to know). 

I think all of this should go into the Excel-Dna project site on CodePlex. If you think you can help, please contact me so that I can add you as Editor or Developer on the CodePlex project. And of course you can send any contributions directly by e-mail to me. 

Thank you for your continued support of Excel-Dna.

Cheers,

Govert

08 October 2010 | Permalink

Excel-Dna version 0.27 - Support for .NET 4

I have posted to the CodePlex site at http://exceldna.codeplex.com/ an update to Excel-Dna that adds support for .Net 4. 

To load the .Net 4 runtime, just add a RuntimeVersion="v4.0" attribute to the DnaLibrary tag in your main .dna file. There are two small samples that show how this works in the Distribution\Samples directory of the .zip file. 

By default, if no directive is present, the .Net 2.0 runtime will be loaded, so existing add-ins should work perfectly with no changes when using this version of Excel-Dna. An Excel session can simultaneously host add-ins that use .Net 2.0 and add-ins using .Net 4 without conflict. You can check which version of the runtime your add-in is running under by checking the value of System.Environment.Version. 

I have also added an option to enable shadow copies on the AppDomain that is created for the add-in. To set this, add a ShadowCopyFiles="true" attribute to the DnaLibrary tag. I have not tested this feature yet. 

As usual, please post any feedback, questions or problems with these 
features to the Google group at http://groups.google.com/group/exceldna.

24 August 2010 | Permalink

Excel-Dna version 0.26 - Ribbon and RTD support

I have posted an updated version of Excel-Dna to the CodePlex site: http://exceldna.codeplex.com .
 
This version adds initial support for the following:
  • Ribbon support for Excel 2007 and 2010 and hierarchical CommandBars for pre-2007 versions.
  • Dynamic RTD server support for Excel 2002 (Office XP) and later.
  • Minor changes to ensure consistent path resolution for References, ExternalLibraries and Images - paths are now checked relative to .dna file path, consistent with ExcelDnaPack.
  • Updated (and multi-thread safe) logging window (thanks to a user contribution).

The new features are not thoroughly documented yet, but there are some samples in the distribution. The best source of information and support remains the Google group: http://groups.google.com/group/exceldna.

12 June 2010 | Permalink

ExcelDna Version 0.25 - Bugfix Release

I have uploaded ExcelDna Version 0.25 to the CodePlex site http://exceldna.codeplex.com. 

The main support site remains the Google group http://groups.google.com/group/exceldna.

This is an important bugfix release, with the following changes:
- Fix case where unpacked .config temp file might not be deleted.
- Fix compiler problem with .Net 2.0 RTM version introduced in version 0.23.
- Fix DateTime parameter OutOfRange crash.
- Show a message if the Integration library fails to run, e.g. due to CAS policy restrictions.

And feedback, problems, examples etc. will be very welcome. You can either post to the Google group or mail me directly to govert@icon.co.za. 

10 April 2010 | Permalink

ExcelDna Version 0.23 - Packing and other features

I have uploaded ExcelDna Version 0.23 to the CodePlex site http://exceldna.codeplex.com. 

The main support site remains the Google group http://groups.google.com/group/exceldna.

This release adds a number of features to ExcelDna, the most 
significant being a packing application that allows you to create a 
single .xll file containing your .dna file(s), compiled .dll libraries 
and other referenced assemblies. I have also implemented a few smaller 
user requests. The new features have corresponding examples in the 
Distribution\Samples directory, but not much other documentation. 
And feedback, problems, examples etc. will be very welcome. You can 
either post to the Google group or mail me directly to 
gov
...@icon.co.za. 

In particular, any help in documenting and testing these features 
would be greatly appreciated. 

17 March 2010 | Permalink

ExcelDna 0.22 Released

I have released ExcelDna version 0.22 on CodePlex (http://exceldna.codeplex.com). 

This version is an important bugfix release that fixes a critical bug 
in the MultiThreaded marshaling support (under Excel 2007). This 
needed significant changes in the Excel 2007 marshaling, so if you 
find any problems with this release, please let me know. 

--Govert --

22 February 2010 | Permalink

Warning - serious multithreading bug in ExcelDna

Hello ExcelDna Users,

A serious bug in the ExcelDna multithreaded support for Excel 2007 has been reported.


High-performance functions that are declared as IsThreadSafe=true, running under Excel 2007, and running on multi-core machines might return incorrect results. In some cases the function might return a result from a different thread, hence from a different calculation.

I'm currently looking at the problem and should be able to release a fix by Monday. The bug is in the marshaling code, where I misunderstood how the custom marshaling interacts with the native stub that the runtime generates.
This does not affect ExcelDna based add-ins running under older version of Excel, or functions that are not explicitly marked as IsThreadSafe=true.


I am very sorry for any trouble or inconvenience this might cause.


Regards,
Govert

20 February 2010 | Permalink

ExcelDna 0.21 Released

I have released a minor update to ExcelDna - version 0.21.

This release and more information is available on the ExcelDna CodePlex site:http://exceldna.codeplex.com.

The main discussion and support forum for ExcelDna is still the Google group at http://groups.google.com/group/exceldna.  

11 January 2010 | Permalink

»