Skip to content

Instantly share code, notes, and snippets.

View govert's full-sized avatar

Govert van Drimmelen govert

  • Excel-DNA
  • Johannesburg, South Africa
View GitHub Profile
@govert
govert / ExcelDna.Samples.ComAddIn.dna
Created July 13, 2011 07:38
Excel-DNA (http://excel-dna.net) sample showing how to make a COM Add-In inside the Excel-DNA .xll. Includes reflection-based workaround for version 0.29.
<DnaLibrary RuntimeVersion="v4.0" Language="C#">
<Reference Name="System.Windows.Forms" />
<![CDATA[
using System;
using System.Reflection;
using SWF = System.Windows.Forms;
using ExcelDna.Integration;
using ExcelDna.Integration.CustomUI;
using ExcelDna.Integration.Extensibility;
@govert
govert / AddInHost.dna
Created September 7, 2011 09:48
Excel-DNA (http://excel-dna.net) sample showing how to load/unload other add-ins from a host add-in
<DnaLibrary Name="AddInHost" Language="C#" RuntimeVersion="v4.0">
<Reference Name="System.Windows.Forms" />
<![CDATA[
using System;
using System.Windows.Forms;
using ExcelDna.Integration;
public class MyMacros
{
@govert
govert / gist:1378887
Created November 19, 2011 14:29
Excel-DNA Dynamic Code from string
<DnaLibrary Name="ExcelDna Test Dynamic Method" Language="C#">
<Reference Name="System.Windows.Forms" />
<![CDATA[
using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Windows.Forms;
using Microsoft.CSharp;
@govert
govert / RangeConvert.dna
Created June 28, 2012 16:47
Excel-DNA - Range processing via COM, with .NET 4 'dynamic'
<DnaLibrary Name="RangeConvert" Language="C#" RuntimeVersion="v4.0">
<Reference Name="System.Windows.Forms" />
<![CDATA[
using System;
using System.Windows.Forms;
using ExcelDna.Integration;
public static class TestRangeMacros
{
@govert
govert / RangeConvertCAPI.dna
Created June 28, 2012 16:48
Excel-DNA - Range processing via the C API
<DnaLibrary Name="RangeConvert using C API" Language="C#" RuntimeVersion="v4.0">
<Reference Name="System.Windows.Forms" />
<![CDATA[
using System;
using System.Windows.Forms;
using ExcelDna.Integration;
public static class TestRangeMacros
{
@govert
govert / gist:b5faa8e26c8d2a5844dd
Last active August 29, 2015 14:01
Excel-DNA file layout for source text reference
<DnaLibrary Name="Excel JSON Client" RuntimeVersion="v4.0" >
<Project Language="VB" >
<Reference Path="Newtonsoft.Json.dll" />
<SourceItem Path="excel-json-client.vb" />
</Project>
</DnaLibrary>
@govert
govert / AsyncBatchExample.cs
Last active September 5, 2023 16:36
Async Batching Sample
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using System.Timers;
using Timer = System.Timers.Timer;
using ExcelDna.Integration;
namespace ExcelDnaSamples
{
@govert
govert / GpsUtils.cs
Last active March 25, 2024 08:43
Convert WGS-84 geodetic locations (GPS readings) to Cartesian coordinates in a local tangent plane (Geodetic to ECEF to ENU)
using System;
using System.Diagnostics;
using static System.Math;
// Some helpers for converting GPS readings from the WGS84 geodetic system to a local North-East-Up cartesian axis.
// The implementation here is according to the paper:
// "Conversion of Geodetic coordinates to the Local Tangent Plane" Version 2.01.
// "The basic reference for this paper is J.Farrell & M.Barth 'The Global Positioning System & Inertial Navigation'"
// Also helpful is Wikipedia: http://en.wikipedia.org/wiki/Geodetic_datum
@govert
govert / AsyncCaller.cs
Created July 2, 2015 21:39
A sample about recovering caller information for async calls, and the effect of different async keys
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading;
using ExcelDna.Integration;
using ExcelDna.Logging;
namespace AsyncCaller
@govert
govert / Excel-DNA CLA.md
Created September 26, 2015 22:08
Excel-DNA Contributor License Agreement

Contributor License Agreement (CLA)

This CLA specifies how the Excel-DNA project is allowed to use your code.

When you make a contribution to the Excel-DNA project, you agree:

  1. The code you wrote is your original work (you own the copyright) or you otherwise have the right to submit the work.

  2. To grant the Excel-DNA project and its coordinator(s) a nonexclusive, irrevocable license to use your submitted code in any way.

  3. You are capable of granting these rights for the contribution.