Channels ▼

Jocelyn Paine

Dr. Dobb's Bloggers

The Spreadsheet Parts Repository for Excel and Google Spreadsheets

January 20, 2009

I am declaring my Spreadsheet Parts Repository open. It's a free service for Excel and Google Spreadsheets users, which will provide tested and documented formula groups that you can download into your own spreadsheets. And hence avoid this:
Cartoon: spreadsheet user despairingly hacks through error-ridden non-modular spreadsheet
by replacing it with this. While setting it up, I seem to have discovered a new kind of advertising.

I explain how the Repository works in a paper Spreadsheet Components For All. My aim — as regular readers will know — is to bring modularity and prefabrication to spreadsheets, by making it possible to build them from components.

Because spreadsheets are visual programming languages, my components correspond to something visible: cell groups. (Incidentally, this makes it possible to see how components work, by giving them rows or columns that display intermediate results.)

But because more than one spreadsheet may want the same component, components must adapt to different spreadsheets: must reshape and resize themselves to fit different locations and layouts.

This, I do by storing components not as fixed pieces of spreadsheet, but as spreadsheet-valued functions whose parameters you supply to a Web form. These parameters specify a component's location and layout in your spreadsheet. This makes inserting a component like inserting a chart into Excel, except that you do it over the Web by filling in a form. The Repository's server will then send you a link to a component instance customised for your spreadsheet. You can download that, and copy it into your spreadsheet with a program available from the Repository.

That's for Excel. But the Repository also works with Google Spreadsheets. If you type your Google Docs account details into the Web form, and the name of a Google Spreadsheet, the server will copy the component instance into that, as well as sending a version for Excel. So this is like inserting a Google Spreadsheet Gadget into your Google Spreadsheet, except that instead of a graph or chart, you're inserting groups of cells holding useful formulae.

I've put up demonstrations on the Repository's Demonstrations and background page. One of these, the section Try for yourself in my presentation Less Excel, More Components, links to downloads which work with Excel. They include various sizes and shape of component instances for you to copy into a sample spreadsheet, also supplied, plus the program that does the copying.

Another demo, Spreadsheet Components, Google Spreadsheets, and Code Reuse, is a Dobbs blog posting with screenshots showing the Repository working with Google Spreadsheets. (The screenshots in these writeups show a prototype of the Repository; the pages now look rather different.)

The spreadsheet-valued functions I mentioned are specified in a language I call Excelsior. Excelsior modules describe spreadsheets in terms of named constants, tables, the types permitted for the table elements, and equations between these elements. Excelsior allows these descriptions to be parameterised with the tables' layouts and locations. This is equivalent to saying how each table is to map onto a worksheet, and is how the Repository's server generates component instances. I've tried to design the Excelsior language so it's easy to read, and also so that it is easy to comment and convert into nice-looking HTML documentation pages, as in this example. Spreadsheets are notoriously poorly documented, but I hope this will help.

Taking this further, I have experimented with a style of documentation called Literate Programming. You can see this at work in the Excelsior code for a spreadsheet I wrote that writes science-fiction plots. It's a complete spreadsheet, rather than a component, but I show it because I think documentation is important, and it is a good example of Literate Programming applied to spreadsheets. The first!

I said I'd discovered a new kind of advertising. Because I want the Repository to be free, I need some way to pay for admin and programming, so I'm looking for sponsors. I'll put sponsors' logos on the home page. But also, I invite sponsors to send me advertising text similar to what Google Adwords accepts. I realised that I could store these texts with the components. Then, when the Repository generates a component instance to be copied into a user's spreadsheet, it can arrange for these texts to be copied into a Sponsors worksheet there. Advertising in downloadable spreadsheet pieces.

Related Reading


More Insights






Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

 
Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.
 


Video