Skip to content
Yu Shen edited this page Feb 28, 2016 · 20 revisions

Welcome to the cljs4excel wiki!

Here are some information or questions about how to use cljs4excel.

Resolution of the problem: not seeing ClojureScript REPL prompt

Here is the description of the problem:

If you follow the instruction at https://www.cljs4excel.com/ After inserting app, you might see the text "cljs4excel" (where "OfficeApp2" is in the illustration at the web page: https://www.cljs4excel.com/) at the right panel next to the spreadsheet, underneath the text, in the same panel, you might see blank white area, but not prompt at all, and you might not enter any text there.

This problem might happen with Excel 2013 and Windows 7 combination.

Here is a solution to the problem:

  1. Try local installation. Starting with git clone https://github.com/cfelde/cljs4excel then follow README.md in the repository.

  2. After completing the installation including adding the task pane to excel, restart excel, create a new file, and insert an application. When loading, it might complaint:

    "To help protect your security, your web browser has restricted this file from showing active content that could access your computer. Click here for options..."

  3. Click the error message prompt to enable the access. initially, it might not work still with the blank at the scratch editor.

  4. Then you can save the new file, and re-open the saved file, the second time it prompts with the same error message of security warning, you can click and enabled starting ActvieX access, then with a few carriage returns, then you may see message of "Loading cljs4excel.. cljs4excel ready.."

BANG! It worked. You will see the scratch editor in dark black background.

Here is the screen when it worked:

Where is further information about the functions to interact with excel, such as get-selection?

There are brief description at https://www.cljs4excel.com/ But it may not be detailed enough.

Based on the illustration at the above link, get-selection gets the content of the selected cells into a matrix (a vector of vectors, where the outer vector are for the rows, that each element is a row, as a (inner) vector.), it passes the matrix to the function fn, which can perform transformation on the content. get-selection return nil, it produces side effect through the function, fn. Thus fn should provide the required transformation, and may need to create desired side effect to the excel, or to the other environment.

How to add my own Clojure namespace and functions in the new namespace to process data in excel?

I guess that one can add namespace in the src/cljs4excel hierarchy. Then one may need to perform the building process again:

lein cljsbuild once

lein resource

Here is an example,