How to use an attachment on one page in another page without copymate?
Asked by Jagbir Singh:

I have 2 seperate pages where I need to use a single excel attachment and I need this attachment to display an excel macro. If I attach the excel file on one page I can create an excel macro on that particular page. In order to display the same file on the other page I have to again attach the same file on the other page. Is there a way to use the attachment on one page on another page and use it to display excel macro.

Thanks

Sunny


Answers:
author: David at David Simpson Apps
body: If the attachment is viewable on both pages, perhaps you could wrap the Excel Macro in an Except Macro on one page, then use the [Except Include Macro](http://confluence.atlassian.com/display/DOC/Excerpt+Include+Macro) on the other.


author: Christian Czaia _Decadis AG_
body: Just in addition to Jamie and David. If you face this problem quite a lot I'd suggest creating an **Inclusions Library** as described here:

[http://confluence.atlassian.com/display/DOC/Creating+your+Technical+Documentation+Space
http://confluence.atlassian.com/display/DOC/_InclusionsLibrary](http://confluence.atlassian.com/display/DOC/_InclusionsLibrary)

> Using Confluence, you can dynamically include content from one page into another page. You can include a whole page into another one, using the [Include macro](http://confluence.atlassian.com/display/DOC/Include+Page+Macro). You can also define an 'excerpt' on a page, and then include that excerpted text into another page using the [Excerpt Include macro](http://confluence.atlassian.com/display/DOC/Excerpt+Include+Macro).
>
> To organise your re-usable content, we recommend that you create a set of pages called an 'inclusions library'.  
> 1. Open the '**Browse** ' menu and select '**Pages**'.
> 2. The '**List Pages** ' screen will appear. Open the '**Add** ' menu and select '**Page** '.  
>    This will add a page at the root of the space, at the same level as the home page.
> 3. Enter a suitable title. We use '**_InclusionsLibrary**'. The unusual format of the title helps to let people know this page is special.
> 4. Enter some content on the page. We enter text explaining the purpose of the inclusions library and how to re-use the content. You can copy our text by clicking through to one of the example pages listed [below](http://confluence.atlassian.com/display/DOC/Creating+your+Technical+Documentation+Space#CreatingyourTechnicalDocumentationSpace-examples).  
>    ![](http://confluence.atlassian.com/download/attachments/226166529/InclusionsLibrary.png?version=1&modificationDate=1288916903167)
> 5. Add child pages containing your re-usable content. See the examples of our own inclusions libraries listed [below](http://confluence.atlassian.com/display/DOC/Creating+your+Technical+Documentation+Space#CreatingyourTechnicalDocumentationSpace-examples).
>
> Some notes about inclusions libraries:
>
> * The inclusions library is not a specific feature of Confluence. The pages in the inclusions library are just like any other Confluence page.
> * The pages are located at the root of the wiki space, not under the home page. This means that they will not appear in the table of contents on the left and they will not be picked up by the search in the left-hand navigation bar either.
> * The pages will be picked up by other searches, because they are just normal wiki pages.
> * We have decided to start the page name with an underscore. For example, '_My Page Name'. This indicates that the page is slightly unusual, and will help prevent people from changing the page name or updating the content without realising that the content is re-used in various pages.
>
> ### Examples of Inclusions Libraries {#toc-hId-1506255303}
>
> Here are some examples in our documentation:
>
> * [Crowd inclusions library](http://confluence.atlassian.com/display/CROWD/_InclusionsLibrary)
> * [Confluence inclusions library](http://confluence.atlassian.com/display/DOC/_InclusionsLibrary)


author: David Peterson
body: If Jamie's suggestion works, it would obviously be the simplest. Otherwise, if you have the Reporting Plugin, you can use {report-on} to allow the attachment to execute in the context of the other page. Something like this:

```
{report-on:value:content "Other Page Name"}{view-excel:my.xls}{report-on}
```

You could turn it into a User Macro to make life simpler if you do this a lot.


author: JamieA
body: Can't you refer to the attachment using the page name, ie SomePage\^file.xls, then have it on both pages using the {include} macro?


Tags: attachment

macro

ms-excel