Converts some excel spreadsheets (.xlsx, not .xls) into some other programming languages (currently ruby or c). This allows the excel spreadsheets to be run programatically, without excel.
Its cannonical source is at http://github.com/tamc/excel_to_code
To just have a go:
NB:For small spreadsheets this will take a minute or so. For large spreadsheets it is best to run it overnight.
for more detail:
./bin/excel_to_c --compile --run-tests --settable <name of input worksheet> --prune-except <name of output worksheet> <excel file name>
this should work:
- Make sure you have ruby 1.9.2 or later installed
- gem install bundler # May need to use sudo
- rspec spec/*
To test the C runtime:
- cd src/compile/c
- cc excel_to_c_runtime
There are some how to guides in the doc folder.
- Not tested at all on Windows
- It must be possible to replace INDIRECT and OFFSET formula with standard references at compile time (e.g., INDIRECT("A"&"1") is fine, INDIRECT(userInput&"3") is not.
- Doesn't implement all functions (see doc/Which_functions_are_implemented.md)
- Doesn't implement references that involve range unions and lists (but does implement standard ranges)
- Sometimes gives cells as being empty, when excel would give the cell as having a numeric value of zero
- The generated C version does not multithread and will give bad results if you try
- The generated code uses floating point, rather than fully precise arithmetic, so results can differ slightly
- The generated code uses the sprintf approach to rounding (even-odd) rather than excel's 0.5 rounds away from zero.
- Ranges like this: Sheet1!A10:Sheet1!B20 and 3D ranges don't work