Coder Social home page Coder Social logo

excel-duckdb's Introduction

excel-duckdb

Excel-duckdb joins the most powerful analytics platform on the planet with duckdb. Excel-duckdb is a poorly written vba-add-in that can be added to any excel file.

Execute sql queries using duckdb against local or remote files, databases, or object storage all from excel!

Jupyter notebooks no more with excel X duckdb!

Installation

Start by installing duckdb-odbc and create a new 64-bit ODBC dsn for DuckDB.

  1. Install: 64-bit ODBC

  2. Create a new ODBC Data Source Name (DSN): Msft ODBC

    • System DSN >> Add >> DuckDB Driver
  3. Create a DSN called: excel-duckdb

Once the setup is complete, you can include the add-in in any excel workbook by searching for Add-ins in the global workbook search, or navigating to the Developer tab >> Excel Add-ins.

From here, click browse and add the excel_duckdb.xlam file as an add-in to raw dog some sql straight into the formula bar for q4 Financials - v2 Final - final - copy.xlsx that you spent all night working on!

Additionally, you will most likely have to add the location of the excel_duckdb.xlam file as a trusted location for the macro to work. This can be accomplished by:

  1. File >> Options >> Trust Center >> Trust Center Settings
  2. Choose the Trusted Locations tab
  3. Add new location
  4. Browse to the folder the excel_duckdb.xlam file is located

You may need to modify other permission, or settings to enable macros. Mileage will vary depending on your setup.

Usage

Query parquet files in object storage, local files on your machine, or even MotherDuck!

TODO: add credential management that is not storing credentials in plain text in VBA.

Users will be limited to 255 characters per query.

=duckdb("
    select *
    from 'https://d37ci6vzurychx.cloudfront.net/trip-data/green_tripdata_2022-02.parquet'
    where passenger_count > 1 and lpep_pickup_datetime::date = '2022-02-15'
    order by 2 desc
")

The response is a dynamic array which can then be shared, or further analyzed with the full power and might of, microsoft excel.

Issues

No testing has been done.

If you run into issues, try toggling off the Protechted View check boxes in the trust center, and ensure that Microsoft ActiveX Data Objects 6.1 Lirbary has been toggled as a reference from the developer tab.

  • Developer Ribbon >> Visual Basic (alt + F11)
  • Tools >> References >> Microsoft ActiveX Data Objects 6.1 Lirbary

Road Map

  • Caching
  • Credential management for object storage

excel-duckdb's People

Contributors

bill-ash avatar

Stargazers

Vincent Murphy avatar  avatar Mario Taddeucci avatar malo_paris avatar

Watchers

 avatar

Forkers

mariotaddeucci

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.