none
Loading template with Excel 2013 task pane app RRS feed

  • Question

  • I have a scenario where an Excel 2013 task pane app requires a formatted template (.xlsx file) to be loaded.

    The template is nicely formatted and also includes named cells and ranges that are required by the task pane app.

    Is there a way to load the template file with the app?

    Thanks

    Friday, January 18, 2013 2:12 AM

Answers

  • An Excel 2013 task pane app cannot automatically load another spreadsheet. You could provide a link to a page on the web where a person could download the template, but that link will open up your default browser - it won't automatically download the file and open it in Excel (unfortunately).

    You can have the app already saved inside the template so that the user does not need to insert the app again into the newly downloaded file.

    Your app could attempt to bind to a named range, and if not found, it could provide a screen that explains that the template file is needed and gives the download url.


    Tuesday, January 22, 2013 12:12 AM

All replies

  • Not really sure if you can load the template. As i understand it you only can change or have access to selected cells.

    For adding predefined columns you could use function that is written on http://msdn.microsoft.com/en-us/library/fp142161.aspx . Just modify it to create columns (instead of rows). Then when user selects first cell and clicks a button in your app, the function would create all the columns (and rows).

    function writeData() {
        Office.context.document.setSelectedDataAsync([["red"],["green"],["blue"]], function (asyncResult) {
            if (asyncResult.status === "failed") {
                writeToPage('Error: ' + asyncResult.error.message);
            }
        });
    }

    Here is maybe a blog taht can help you

    http://www.add-in-express.com/creating-addins-blog/2012/11/22/develop-excel-task-pane-app/


    Anze Javornik

    Friday, January 18, 2013 11:35 AM
  • An Excel 2013 task pane app cannot automatically load another spreadsheet. You could provide a link to a page on the web where a person could download the template, but that link will open up your default browser - it won't automatically download the file and open it in Excel (unfortunately).

    You can have the app already saved inside the template so that the user does not need to insert the app again into the newly downloaded file.

    Your app could attempt to bind to a named range, and if not found, it could provide a screen that explains that the template file is needed and gives the download url.


    Tuesday, January 22, 2013 12:12 AM
  • thank you for help

    >>But How to have the app already saved inside the template so that the user does not need to insert the app again into the newly downloaded file.

    I have a template in (.xltx) format.How can i connect it to my task Pane app.

    So that taskPane app loads inside this template


    • Edited by tusharWAi Tuesday, March 11, 2014 6:34 AM
    Tuesday, March 11, 2014 6:31 AM