Availability

Child pages
  • Excel Macro

Skip to end of metadata
Go to start of metadata

On this page

Overview

The Excel macro displays one or more Excel worksheets on a Confluence page. The following features are included:

  • Supports many Excel formats:

    • xls format from Excel 95, 97, 2000, XP, and 2003 workbooks

    • xlsx format from Excel 2007 and later (available starting with Release 5.0)

  • Flexible location of the Excel file

    • Attachment
    • URL
    • File system of Confluence server
  • Compatible with the Chart macro to create charts
  • Sheet selection - one or more or all
  • Column selection - any of the columns including hidden columns
  • Supports Common Table Capabilities including sorting, auto numbering, auto total, and styling
  • Enables conversion of spreadsheets to native tables
  • Enabled for Macro Security for Confluence to allow control of url and profile parameters. See Macro Security Managed Macros.

Basic Use

This macro can be deployed using one of the following methods:

Selected from the Macro BrowserExcel
Markup Shortcut{excel}

Screenshot

Parameters

Common Table parameters

The following parameters are part of our common table capabilities that are available to many macros that produce or modify tables.

(info) Click a column heading to toggle the sorting of that column.

Compatibility With Other Macros

 

37 Comments

  1. Please create an issue for things like this so it doesn't clog up the page with stack traces. Anyway, this is a Confluence issue http://jira.atlassian.com/browse/CONF-16121.

  2. I am new to Confluence and having difficulty finding installation instructions for the Excel plugin.  Can someone please point me to the right place?  Please disregard - found the problem - did not realize the "zip" file from Windows was actually the jar.

    1. And it easier to use the Confluence plugin repository.

  3. Any news of this plugin being ready for Confluence 3.3?

    1. It should work, but not tested yet. Plugin Exchange will not be updated until testing is done. Download and install manually in the meantime.

  4. Hi Bob,

    Does this polugin support special characters like accents (spanish)? I am trying different parameters but I get a question sign inside a diamond in place of the special character.

    Thanks,

    1. Yes, see encoding parameter if your excel file has different encoding than your server. Usually your server will be UTF8.

      1. Yes, the server is UTF-8 , and I can see áíé and ñ in the pages, but the table renders these characters as a question mark inside a diamond.... I tried encode=UTF-8 in the macro parameters but I can´t get those characters to display correctly.

        Update: Actually with encoding=ISO-8859-1 it works OK.

        1. Was the file created on a Windows system? Then windows-1250 or one of the other windows encodings might work. Some help is here - http://stackoverflow.com/questions/508558/what-charset-does-microsoft-excel-use-when-saving-files.

          Update: (smile). ISO-8859-1 is same/similar to one of the windows ones.

  5. Hi Bob,

    excel:file=^vinculos.xls|encoding=ISO-8859-1|border=2|formatColumn=false|hyperlinks=false|enableSorting=false|autoNumber=true|sortColumn=1|highlightColor=lightyellow

    Everything looks nice, but I am trying to make the highlighting work, but it shows nothing. This is Confluence 3.4.2 and Firefox. Is there any caveats about this feature?

    1. Are you referring to mouse over highlighting (lightyellow in your case) or something coming from the excel file? If the latter, you can open an issue and attach your excel file to it.

      1. Yes, and I found out the problem, it is the Documentation theme used in the space. Somehow the onmouseover doesn´t work right in this case.

        1. Yes, that is a known problem DOC-21 affecting table, sql, csv, and excel macros.

  6. Hi Bob,

    sorry, but I don't quite understand this security thing. Do I have to install the Macro Security Plugin to ensure that the disableAntiXss parameter can only be used by admins? Or is this by default and only if I want to enable other users to use this do I have to install the MSP?
    Somehow I cannot tell from the documentation if it is necessary to install it if I want to use the Excel Plugin correctly.

    Thanks a lot,
    Karola

    1. Sorry, it is confusing (sad). No, you don't need Macro Security for Confluence - antiXss is enabled (based on your global setting). You only need Macro Security for Confluence if you want to allow some users to disable it for specific cases.

      1. Thanks for the clarification! Then my understanding wasn't that wrong.

        It was just that I logged in as normal user in my test instance and still got the option to stop the encoding. So now the user can tick it but it won't have any effect right?

        1. Correct. You are talking about the macro browser. I suppose that parameter could be removed from the macro browser since it is a specialized capability and may confuse regular users.

          1. Thanks a lot! I will put this in our internal documentation so no other admin will stumble upon that.

  7. I can't seem to add the plugin in excel. When I expand the jar I don't see an executable excel will recognize.

  8. Hi, does this allow for accessing network files? I have tried to use the URL field with \\van.com\root\IS_Documents\Business Analysis\Business Requirements\Question Tracker\Question Tracker POS_net.xls for example but it does not work. This is the exact same path i use in other confluence hyperlinks.

    Alternatively i can't seem to work out where to drop the file if is use the "#filename - Data is read from the file located in confluence home directory/script/filename." option, it erros stating C:xxxxx

    Thanks

    Simon

      1. Not sure about UNC path access, perhaps someone else has experience with that
      2. #filename looks for files underneath script directory in your confluence home directory - example: #test.xls
      1. Thanks for the reply.

        I am getting the following error when is use #filename options:

        excel: File: 'C:\confluence\data\script\test.xls' does not exist.
         
        When I look at the confluence directory, there was no existing folders for data\script, i added, but got the above.
         
        Any ideas appreciated.
         
        Cheers

        1. That is where the xls file needs to be located - the error indicates that it was not found. If you still think there is a problem with the plugin, open an issue and provide your wiki markup and snapshot of your directory showing the file.

          1. Thanks, finally got it to work, was using the wrong path!

            Just what i as looking for!

            Is there an equivalent for other office docs, word and project? Couldnt find one, and i wish to view a file and not attachements.

            Cheers!

            1. Not that I am aware of. Similar support is available for csv, groovy (and similar), html, ... macros.

  9. Hi Bob,

    I developed a proto for a similar extension based on POI (which supports both .xls and .xlsx files). Initially it was intended to post-process dokuwiki articles, but my company decided to adopt confluence, so I discovered your Excel plugin.

    If you are interested in the functionality (see description below) or the POI interaction, I can participate/post some code.

    Thanks,

    Damien


    Brief description

    Handles processing instructions in the wiki text of the form:

    <excel ...>[<match ...>]</excel>
    

    attributes for element excel element can be

    • dir - example: dir="c:\temp". directory used for search the excel file
    • filepattern - example: filepattern="file_*.xls". If the filename contains a pattern, the most recent file matching the pattern will be used.
    • headerrange - example: headerrange="Sheet1!B3:F3". This will lead to header cells in the wiki markup.
    • datarange - example: datarange="Sheet1!C3:F8". This will lead to data cells in the wiki markup.
    • transpose - example: transpose="true"
    • caption - example: caption="some text"

    If datarange is not present, a child match defines the data based on a matching process.
    Attributes for element match can be

    • location - example: sourcefile="Sheet1!A". the name of the sheet and optional column where to find the matching data. or sourcefile="Sheet1![title]" to find a column for the match which has a cell containing "title"
    • value - example: value="208*". the value to search for (simple wildcards are accepted or java regex). the data range will be taken on the row of the match
    • hrange - hrange="B:F". the horizontal range (columns) from which data needs to be taken on the matching row.
    • instance - example: instance="first|all". Tells if the data is only made of the first match or of all the matches.
    Examples:

    The following creates a table with header taken from Sheet1!A2:H2 and data taken from Sheet1!A3:H4

    <excel dir="c:\temp\doc" filepattern="test_*.xls" headerrange="Sheet1!A2:H2" datarange="Sheet1!A3:H4" transpose="false/>
    

    The following creates a table with header taken from Sheet1!A2:H2 and data taken from the rows which match regex "20021.5" in column with title "Reference" Sheet1!A3:H4

    <excel dir="c:\temp\doc" filepattern+="test_*.xls" headerrange="Sheet1!A2:H2">
       <match location="Sheet1![Reference]" value="20021.5" +hrange="A:H" instance="all"/>
    </excel>
    

    In a sheet containing

     

    A

    B

    C

    1

     

     

     

    2

    ...

    Reference

    ...

    3

     

    Reference

     

    4

     

    2002185

     

    5

     

    2003185

     

    6

     

    2002195

     

    the second example would extract rows 3 and 5 as they match 20021.5...

    1. Damien, thanks for the suggestion. I initially started with POI many years ago, but it didn't have the right support at that time. Switching over to POI might be a good thing to do now. Unfortunately, I will not have time to investigate changing over now or anytime in the next few months. Excel is lower priority than other things because there is now Confluence Office connector that covers a good deal of this. I suggest you create an issue with the information above and point to or attach any code you want contribute to the issue.

  10. Hi Bob,

    big surprise today (at least to me). Confluence prompted me to upgrade the Universal Plugin Manager.

    After I had done so, the "Excel Plugin" was now shown as "Bob Swift Software - Excel Plugin" and has a "buy now" button. Same for the HTML and Macro Security plugins.

    While I understand your desire to commercialize your spare time work, I disliked to learn about it by surprise and by updating the plugin manager.

    Do you plan to commercialize other plugins of yours as well, e.g. the Table-Plus macro or the Chart macro? They are currently still listed under BSD.

    (this would be even worse surprises)

    Regards,

    Hans-Peter

    1. Hans-Peter, sorry about that. Here is the announcement. But, it is hard to for people to find out until they see it in the UPM. If you upgrade your UPM to a more recent version, then the information is more visible prior to upgrading. You can downgrade to the previous level. I will be publishing better information (watch Products) for planning purposes in a few days as well. Specifically, table-plus is already listed and the existing chart support is unlikely to be changed as it is bundled with Confluence and supported by Atlassian.

      1. Hi Bob,

        yep, I found your announcement this morning when I started looking around after the UPM upgrade surprise. I'm going to watch your Project Summary page now, although it doesn't tell yet what I was looking for.

        What do you mean by "table-plus is already listed" ?  What's your plan for it?

        In UPM (Manage Plugins), it is still listed as Table Macro, not Bob Swift Software - Table Macro, as you might expect. Its marketplace link though tells that it is Bob Swift Software, but there is no license price mentioned. Is this your plan to do?

        Funny, while UPM under Manage Software lists "Bob Swift Software - Excel Macro" plus the Buy Now button, the "Find new plugins" functionality of the same tool still has the previous "Excel Macros for Confluence", and it tells "Paid by Atlassian".  See attachment ... find new plugins.JPG

          1. I am working on the page update automation, there will be a few updates coming in the next few days and then you can see if it meets your needs
          2. See https://marketplace.atlassian.com/plugins/org.swift.confluence.table
          3. Probably you are on Confluence 3.x, the commercial version is Confluence 4.x only
          4. Excel Macro: They are the same
          1. Hi Bob,

            thanks for the clarification that the commercial version is for 4.x only. Yes, we are still on 3.5, so the "buy now" button in the UPM should not have appeared.  (marketplace configuration??)

            We'll stay on 3.5 for at least 6 or 9 more months before considering a 4.x migration. I want to give Atlassian more time to fix more problems of the new editor. Reading all these negative comments on the Editor 4.x feedback page is not encouraging to me to take this burden and get the same negative comments from my users.

            We do have some Wiki-markup fans, too, so we might need to buy your Wiki plugin then.  (wink) I wish the situation was different, though.

            regards,

            Hans-Peter

            1. Hans-Peter, yes I hear you. At Vision, we delayed upgrading as well and are now just looking at 4.3. It is a major effort that I am still helping them with. The new editor is nice in many ways, but there are certainly annoyances that harder to manage with a company rollout. The Wiki plugin is intended to remain open source/free. It is relatively simple to maintain and support. It will be supported like a commercial plugin.

  11. Hi,

    I am having great troubles in importing Excel files to confluence, your plugin works the best for now, however i still have problems. Is there any way i can perform sorting within the column like i do it in excel?

    1. Sorry you are having trouble. Entire column (click on 1st row) can be sorted or auto sorted. It is not possible to sort within the column.