├── xls
├── cron1.xls
├── cron2.xls
├── cron3.xls
├── wsock1.xls
├── quandl1.xls
├── quandl2.xls
├── quandl3.xls
├── tiingo1.xls
├── tiingo2.xls
├── tiingows1.xls
├── quandl1_proxy.xls
├── quandl2_proxy.xls
├── quandl3_proxy.xls
├── tiingo2_proxy.xls
├── tiingows1_proxy.xls
├── tiingows_option1.xls
├── baremetrics_plan1.xlsx
├── flight_bare_model1.xls
├── flight_bare_model2.xls
├── baremetrics_metric1.xlsx
├── baremetrics_summary1.xlsx
├── flight_bare_model1.xlsx
├── ganalytics_sessions1.xlsx
├── ganalytics_sessions2.xls
├── ganalytics_sessions2.xlsx
├── ganalytics_sessions3.xls
└── tiingows_option1_proxy.xls
├── src
├── bin
│ ├── Debug
│ │ ├── SSAddin.xll
│ │ ├── SSAddin64.xll
│ │ └── SSAddin.dna
│ └── Release
│ │ ├── SSAddin.xll
│ │ └── SSAddin64.xll
├── Properties
│ └── AssemblyInfo.cs
├── Packages
│ ├── Excel-DNA.0.30.3
│ │ └── content
│ │ │ └── ExcelDna-Template.dna
│ ├── Excel-DNA.0.32.0
│ │ └── content
│ │ │ └── ExcelDna-Template.dna
│ └── Packages.config
├── SSAddin.xll.config
├── ssaddin.dna
├── AddIn.cs
├── Logr.cs
├── TiingoRealTimeMessageHandler.cs
├── ProxyConnectorBase.cs
├── WSCallback.cs
├── GoogleAnalyticsAPI.cs
├── RTDServer.cs
├── JsonToDictionary.cs
├── ssaddin.csproj
├── HttpConnectProxy.cs
├── DataCache.cs
├── CronManager.cs
├── TWSCallback.cs
├── WorksheetFunctions.cs
├── ConfigSheet.cs
└── SSWebClient.cs
├── docs
├── index.rst
├── install.rst
├── config.rst
├── make.bat
├── functions.rst
└── conf.py
├── cfg
└── SSAddin.xll.config
├── README.md
└── LICENSE
/xls/cron1.xls:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpreadServe/SSAddin/HEAD/xls/cron1.xls
--------------------------------------------------------------------------------
/xls/cron2.xls:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpreadServe/SSAddin/HEAD/xls/cron2.xls
--------------------------------------------------------------------------------
/xls/cron3.xls:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpreadServe/SSAddin/HEAD/xls/cron3.xls
--------------------------------------------------------------------------------
/xls/wsock1.xls:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpreadServe/SSAddin/HEAD/xls/wsock1.xls
--------------------------------------------------------------------------------
/xls/quandl1.xls:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpreadServe/SSAddin/HEAD/xls/quandl1.xls
--------------------------------------------------------------------------------
/xls/quandl2.xls:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpreadServe/SSAddin/HEAD/xls/quandl2.xls
--------------------------------------------------------------------------------
/xls/quandl3.xls:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpreadServe/SSAddin/HEAD/xls/quandl3.xls
--------------------------------------------------------------------------------
/xls/tiingo1.xls:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpreadServe/SSAddin/HEAD/xls/tiingo1.xls
--------------------------------------------------------------------------------
/xls/tiingo2.xls:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpreadServe/SSAddin/HEAD/xls/tiingo2.xls
--------------------------------------------------------------------------------
/xls/tiingows1.xls:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpreadServe/SSAddin/HEAD/xls/tiingows1.xls
--------------------------------------------------------------------------------
/xls/quandl1_proxy.xls:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpreadServe/SSAddin/HEAD/xls/quandl1_proxy.xls
--------------------------------------------------------------------------------
/xls/quandl2_proxy.xls:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpreadServe/SSAddin/HEAD/xls/quandl2_proxy.xls
--------------------------------------------------------------------------------
/xls/quandl3_proxy.xls:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpreadServe/SSAddin/HEAD/xls/quandl3_proxy.xls
--------------------------------------------------------------------------------
/xls/tiingo2_proxy.xls:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpreadServe/SSAddin/HEAD/xls/tiingo2_proxy.xls
--------------------------------------------------------------------------------
/xls/tiingows1_proxy.xls:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpreadServe/SSAddin/HEAD/xls/tiingows1_proxy.xls
--------------------------------------------------------------------------------
/xls/tiingows_option1.xls:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpreadServe/SSAddin/HEAD/xls/tiingows_option1.xls
--------------------------------------------------------------------------------
/src/bin/Debug/SSAddin.xll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpreadServe/SSAddin/HEAD/src/bin/Debug/SSAddin.xll
--------------------------------------------------------------------------------
/xls/baremetrics_plan1.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpreadServe/SSAddin/HEAD/xls/baremetrics_plan1.xlsx
--------------------------------------------------------------------------------
/xls/flight_bare_model1.xls:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpreadServe/SSAddin/HEAD/xls/flight_bare_model1.xls
--------------------------------------------------------------------------------
/xls/flight_bare_model2.xls:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpreadServe/SSAddin/HEAD/xls/flight_bare_model2.xls
--------------------------------------------------------------------------------
/src/bin/Debug/SSAddin64.xll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpreadServe/SSAddin/HEAD/src/bin/Debug/SSAddin64.xll
--------------------------------------------------------------------------------
/src/bin/Release/SSAddin.xll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpreadServe/SSAddin/HEAD/src/bin/Release/SSAddin.xll
--------------------------------------------------------------------------------
/src/bin/Release/SSAddin64.xll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpreadServe/SSAddin/HEAD/src/bin/Release/SSAddin64.xll
--------------------------------------------------------------------------------
/xls/baremetrics_metric1.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpreadServe/SSAddin/HEAD/xls/baremetrics_metric1.xlsx
--------------------------------------------------------------------------------
/xls/baremetrics_summary1.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpreadServe/SSAddin/HEAD/xls/baremetrics_summary1.xlsx
--------------------------------------------------------------------------------
/xls/flight_bare_model1.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpreadServe/SSAddin/HEAD/xls/flight_bare_model1.xlsx
--------------------------------------------------------------------------------
/xls/ganalytics_sessions1.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpreadServe/SSAddin/HEAD/xls/ganalytics_sessions1.xlsx
--------------------------------------------------------------------------------
/xls/ganalytics_sessions2.xls:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpreadServe/SSAddin/HEAD/xls/ganalytics_sessions2.xls
--------------------------------------------------------------------------------
/xls/ganalytics_sessions2.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpreadServe/SSAddin/HEAD/xls/ganalytics_sessions2.xlsx
--------------------------------------------------------------------------------
/xls/ganalytics_sessions3.xls:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpreadServe/SSAddin/HEAD/xls/ganalytics_sessions3.xls
--------------------------------------------------------------------------------
/xls/tiingows_option1_proxy.xls:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpreadServe/SSAddin/HEAD/xls/tiingows_option1_proxy.xls
--------------------------------------------------------------------------------
/docs/index.rst:
--------------------------------------------------------------------------------
1 | .. SpreadServe Addin documentation master file, created by
2 | sphinx-quickstart on Thu Aug 06 13:34:13 2015.
3 | You can adapt this file completely to your liking, but it should at least
4 | contain the root `toctree` directive.
5 |
6 | SpreadServe Addin
7 | =================
8 |
9 | Contents:
10 |
11 | .. toctree::
12 | :maxdepth: 2
13 |
14 | install
15 | functions
16 | config
17 |
18 |
19 | Indices and tables
20 | ==================
21 |
22 | * :ref:`genindex`
23 | * :ref:`modindex`
24 | * :ref:`search`
25 |
26 |
--------------------------------------------------------------------------------
/src/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | [assembly: AssemblyTitle("SSAddin")]
5 | [assembly: AssemblyDescription("SSAddin Excel Add-In")]
6 | [assembly: AssemblyCompany("Babbington Slade Ltd")]
7 | [assembly: AssemblyProduct("SSAddin Excel Add-In")]
8 | [assembly: AssemblyCopyright("Copyright © 2015 Babbington Slade")]
9 |
10 | [assembly: ComVisible(false)]
11 | [assembly: Guid("0EB1C849-A6D0-448B-A2FD-DCC7338D8FF7")]
12 |
13 | [assembly: AssemblyVersion("1.0.0.0")]
14 | [assembly: AssemblyFileVersion("1.0.0.0")]
15 |
16 |
--------------------------------------------------------------------------------
/src/bin/Debug/SSAddin.dna:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/src/Packages/Excel-DNA.0.30.3/content/ExcelDna-Template.dna:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
19 |
20 |
--------------------------------------------------------------------------------
/src/Packages/Excel-DNA.0.32.0/content/ExcelDna-Template.dna:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
19 |
20 |
--------------------------------------------------------------------------------
/src/Packages/Packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/cfg/SSAddin.xll.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/src/SSAddin.xll.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/src/ssaddin.dna:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/AddIn.cs:
--------------------------------------------------------------------------------
1 | // Copyright Babbington Slade Ltd
2 | using System;
3 | using System.Diagnostics;
4 | using System.Net.PeerToPeer;
5 | using ExcelDna.Integration;
6 |
7 | namespace SSAddin {
8 | public class AddIn : IExcelAddIn {
9 | private static TraceSource m_TraceSource = new TraceSource( "ssaddin");
10 |
11 | // We don't use System.Net.PeerToPeer.PeerName anywhere in the SSAddin code.
12 | // This is here to force loading of System.Net.dll 4.0.0.0 before Google.Apis.dll
13 | // asks for v2.0.5.0 as described in the link below. For some reason assembly
14 | // bindingRedirects in SSAddin.xll.config don't work for System.Net.dll, even
15 | // though they do work for System.Net.Http.Primitives. I don't want to have
16 | // to require the KB2468871 fix, which wouldn't install on my Win8 laptop
17 | // anyway. One more thing: if you're trying to do bindingRedirects in your
18 | // .xll.config, do make sure ExcelDnaPack isn't packing it into the XLL. It
19 | // will if it find a .xll.config with a matching base name next to the .dna
20 | // file. JOS 2017-05-06
21 | // https://github.com/google/google-api-dotnet-client/issues/378
22 | // http://blog.slaks.net/2013-12-25/redirecting-assembly-loads-at-runtime/
23 | private static PeerName m_PeerName = new PeerName( "dummy" );
24 |
25 | public void AutoOpen( ) {
26 | Logr.Log( "AutoOpen" );
27 | ExcelIntegration.RegisterUnhandledExceptionHandler( e => "EXCEPTION: " + (e as Exception).Message);
28 | }
29 |
30 | public void AutoClose( ) {
31 | Logr.Log( "AutoClose" );
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/Logr.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading;
7 |
8 | namespace SSAddin {
9 | class Logr {
10 |
11 | protected static TextWriterTraceListener m_TextOut;
12 |
13 | static Logr( ) {
14 | // Trace goes to /dev/null in Release mode unless some kind of debug tool is used.
15 | // Need to add a listener to send to localFS. JOS 2015-05-19
16 | string logpath = String.Format( "{0}\\ssaddin_{1}.log", System.IO.Path.GetTempPath( ), Process.GetCurrentProcess( ).Id);
17 | m_TextOut = new TextWriterTraceListener( System.IO.File.CreateText( logpath));
18 | Trace.Listeners.Add( m_TextOut);
19 | }
20 |
21 | public static void Log( string ln ) {
22 | // Add code here to add threadId, processId and timestamp
23 | // Why? https://msdn.microsoft.com/en-us/library/system.diagnostics.tracelistener.traceoutputoptions%28v=vs.100%29.aspx
24 | // Yes: TextWriterTraceListener WriteLine ignores the TraceOptions that add ThreadId, ProcessId etc
25 | // And I can't get FileLogTraceListener to add those either. Can I be arsed with all the TraceEvent crap necessary?
26 | // No! I'm writing multi threaded code, so I want my log lines to have threadIds without any explicit code on my part!
27 | // Is that too much to ask?
28 | string tstamp = DateTime.Now.ToString( "o");
29 | int tid = Thread.CurrentThread.ManagedThreadId;
30 | int pid = Process.GetCurrentProcess( ).Id;
31 | Trace.WriteLine( String.Format( "{0} {1} {2} {3}", tstamp, pid, tid, ln ));
32 | // In release mode writes are buffered, but we want to see them logged immediately, so flush.
33 | Trace.Flush( );
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # SSAddin
2 | SSAddin, the SpreadServe Addin is a conventional Excel XLL addin implemented in C#. It has no build or run time dependencies on the [SpreadServe](http://spreadserve.com>) server runtime, and can be used independently in a regular desktop Excel installation, or in [SpreadServe](http://spreadserve.com>) itself. SSAddin supports quandl, cron style scheduled execution, and web socket live updates. SSAddin is freely available under the Apache License 2.0
3 |
4 | ## Binaries
5 | You can download ready to install 32 & 64 bit binaries from [SpreadServe's download page](http://spreadserve.com/s3/downloads.html).
6 |
7 | ## Google Analytics
8 | SSAddin gives you access to Google Analytics Reporting v3 API via the s2ganalytics and s2gacache worksheet functions. See the ganalytics_sessions2.xls worksheet for an example.
9 |
10 | ## Baremetrics
11 | SSAddin gives you access to the Baremetrics API via the s2baremetrics and s2bcache worksheet functions. See the baremetrics_summary1.xlsx worksheet for an example.
12 |
13 | ## Quandl
14 | quandl.com already distributes a perfectly good Excel addin, so how is SSAddin different? SSAddin uses no VBA and no GUI. It has no menu cluttering your Excel menu bar, no dialog or message boxes popping up. Everything is achieved via worksheet functions, and all network round trips are handled on a background thread so your Excel UI never blocks waiting for data to download from quandl.com.
15 |
16 | ## Tiingo
17 | Tiingo is an exciting new financial data portal challenging high priced incumbents like Bloomberg and Thomson Reuters. Recently tiingo.com has added API access to historical data, which is now supported by SSAddin.
18 |
19 | ## Cron
20 | SSAddin enables the creation of cron style timer jobs in Excel that trigger RTD updates on the schedule you specify. Cron timers can be used to trigger recalculations, or to launch scheduled downloads from quandl.com
21 |
22 | ## Today
23 | SSAddin provides the s2today function. s2today is a non volatile eqivalent of Excel's TODAY. It enables invocation in spreadsheets using RTD without triggering endless calc cycles.
24 |
25 | ## Web sockets
26 | SSAddin supports subscription to live ticking web data via web sockets.
27 |
28 | ## Documentation
29 | http://spreadserve-addin.readthedocs.org/en/latest/index.html
30 |
31 | ## Acknowledgements
32 | SSAddin builds on several other excellent OSS projects: Excel-DNA, NCrontab, WebSockets4Net and JSON.NET. We use a modified NCrontab that extends Unix style cron schedules to allow more finegrained timing specifications using seconds as well as minutes, hours, days and days of the week.
33 |
34 | ## Contact
35 | john dot osullivan at spreadserve dot com
36 |
37 |
--------------------------------------------------------------------------------
/src/TiingoRealTimeMessageHandler.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using WebSocket4Net;
6 |
7 | namespace SSAddin {
8 | class TiingoRealTimeMessageHandler {
9 |
10 | public delegate void MktDataTick( IList