Skip to content

jpgough/quandl-excel-windows

 
 

Repository files navigation

Quandl Excel Add-in for Windows

The Quandl Excel Add-In allows you to search through, find and download any of Quandl's millions of datasets directly from within Microsoft Excel. It's completely free; usage is unlimited and unrestricted. Currently this Add-in is limited to windows only as it uses features and functions which are only available on the windows version of excel.

Development

A few things that will make your excel development experience much easier:

  • Excel is single threaded
  • Use Async tasks and don't block with long running code. This will block the Excel UI due to it being single threaded.
  • When making calls to excel via ExcelDNA thing of Excel as the server and our ExcelDNA app as the client. Design your application as if you are making requests of excel which it may or may not fulfill. Also not that the Excel server can be busy (overloaded) due to its single threaded nature and you may need to wait and retry your call later to fulfill it.

Generating Certificate

  1. Download DigiCert Utility if not already done. https://www.digicert.com/util

  2. Create CSR

  3. Submit the CSR to DigiCert order and re-issue certificate

  4. Download the certificate as .p7b file and import it into the utility.

  5. Export it has a pfx file in order to use it when signing the code.

Setup

  1. Install Add-in Express for Office and .NET from [https://www.add-in-express.com/downloads/adxnet.php]. Any edition will work. Note that trial version is not available, you need to purchase your license.
  2. Install WiX toolset from http://wixtoolset.org/.
  3. Right click solution file and select Restore NuGet Packages (If you don't have NuGet, please install it at https://dist.nuget.org/index.html)
  4. Make sure that you have ildasm tool from Microsoft SDK installed. You need it to sign assemblies with strong name (see the next step). The solution has been tested with SDK 10.0A
  5. Modify 3rdparty\makesn.cmd to change path to SDK folder (for sn.exe, ildasm.exe tools) and possibly to Microsoft.NET folder (for ilasm.exe tool), if appropriate.
  6. Run 3rdparty\makesn.cmd. It should create strongly signed versions of Markdown.Xaml.dll, octokit.dll, SharpRaven.dll and Syroot.Windows.IO.KnownFolders.dll.
  7. Make sure adxloader64 and adxloader are copied in Quandl.Excel.Addin\Loader directory. You can find them in C:\Program Files (x86)\Add-in Express\Add-in Express for .NET\Redistributables
  8. Make sure dpca.dll is copied (should be in the Downloads folder of the Windows VM) to Quandl.Excel.AddinSetup\4.0.0\Resources.
  9. Make sure vdwtool.exe (should be in C:\Program Files (x86)\Add-in Express\Add-in Express for .NET\Redistributables) is copied to Quandl.Excel.AddinSetup\4.0.0\Resources.
  10. Go to the project properties for Quandl.Excel.Addin
  11. Click on signing tab
  12. Click Create Test Certificate without a password
  13. Repeat 3 last steps for Quandl.Excel.Console
  14. Go to the project properties for Quandl.Excel.UDF.Functions
  15. Under Debug change the Start Action from Start Project to Start External Program
  16. Fill in the path to your chosen version of Excel in the Textbox
  17. Under Start Options in the Command Line Arguments text field enter Quandl.Excel.UDF.Functions-AddIn.xll
  18. Whitelist your development plugin in Excel
    1. Open Excel
    2. Click File -> Options -> Truste Center
    3. Click Trust Center Settings
    4. Click Trusted Locations -> Add New Location
    5. Enter the root directory of your project, example C:\Users\Developer\Projects\quandl-excel-windows\
    6. Ensure Subfolders of this location are also trusted is checked
    7. Click OK
  19. You should now be able to build the project.

Building a Release package

Following steps will create a setup package which works for both Microsoft Excel 32 bit and 64 bit.

Releasing

  1. Ensure the setup project is signed Quandl.Excel.Addin.Setup -> 6 Prepare for Release => Releases => SingleImage => Signing
  • See SIGNING
  • In the middle of this process you will need to actually build the addin:
    • First you should do: Have 6 out 8 projects loaded. Proceed to “rebuild” main solution ‘quandl-excel-windows-adx’.
    • During the break in signing script, when prompted to build the actual AddinSetup installer, do: “Build” the Quandl.Excel.AddinSetup project
  1. Navigate to Quandl.Excel.Addin.Setup -> Product.wxs
  2. Change the product code (use the helper - {...})
  3. Bump the version number. * Be sure to leave the upgrade code untouched.
  4. Navigate to the Quandl.Excel.Addin -> Properties => Publish and update the version to match the setup version.
  5. Navigate to the Quandl.Shared.Modules -> Utilities => ReleaseVersion and update the version to match the setup version.
  6. Switch your Run Mode to release instead of debug
  7. Right click solution file and select Rebuild Solution

Things to note:

  • You might need to kill processs msbuild.exe to recompile the solution.
  • ProductId is set to * in Quandl.Excel.AddinSetup -> Product.wsx
  • we are using Markdown.XAML to generate the flowdocument from the github markup. For more info check out the github page.
  • When testing, if your plugin does not appear in Excel, check that it was not added to the Disabled Items list. To check:
    • Open Excel
    • Click File -> Options -> Add-Ins
    • Under the Manage dropdown, select Disabled Items and click GO
    • Enable any instance of the Quandl Add-In that appear there

Unit testing

See Unit Testing Guide

FAQ

For a list of excel exceptions and how to debug them please see: Errors

My UDF function was running along great but then appears to have stopped updating

This could be a number of things but generally means that our implementation has run into one of the following problems:

  • Unhandled excel exception - Excel has many mysterious exceptions that result in COMException errors. If left unhandled they can crash excel or stop the running UDF.
  • Threading deadlock - This can happen if we use our threads in a non thread safe way. Basically we are not handling a specific case properly.
  • Excel request deadlock - This can occur when excel is busy and we try to make another request to it from a different thread.
  • Unhandled server error response - Our server is having issues and after a few retries our code simply gives up.

License

See LICENCE file for licence rights and limitations (MIT)

About

Quandl Excel Addin for Windows

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 80.5%
  • XSLT 11.7%
  • Rich Text Format 7.6%
  • PowerShell 0.2%