Note: This repo is archived and no longer actively maintained. Security vulnerabilities may exist in the project, or its dependencies. If you plan to reuse or run any code from this repo, be sure to perform appropriate security checks on the code or dependencies first. Do not use this project as the starting point of a production Office Add-in. Always start your production code by using the Office/SharePoint development workload in Visual Studio, or the Yeoman generator for Office Add-ins, and follow security best practices as you develop the add-in.
Table of contents
- Summary
- Prerequisites
- Key components of the sample
- Build and debug
- Troubleshooting
- Questions and comments
- Additional resources
##Summary This sample demonstrates how to save custom settings inside an Excel Add-in. The add-in stores data as key/value pairs, using the JavaScript API for Office property bag, browser cookies, web storage (localStorage and sessionStorage), or by storing the data in a hidden div in the document. The add-in also demonstrates best practices for implementing multiple-page navigation in an add-in for Office.
This sample requires the following:
- Visual Studio 2013 with Update 5 or Visual Studio 2015.
- Excel 2013
- Internet Explorer 9 or later, which must be installed but doesn't have to be the default browser. To support Office Add-ins, the Office client that acts as host uses browser components that are part of Internet Explorer 9 or later.
- One of the following as the default browser: Internet Explorer 9, Safari 5.0.6, Firefox 5, Chrome 13, or a later version of one of these browsers. Familiarity with JavaScript programming and web services.
The Persist custom settings sample add-in contains the following notable files:
The CodeSample_PersistCustomSettings project, including:
- CodeSample_PersistCustomSettings.xml manifest
- Home.js file
- Home.html file
- StorageLibrary.js file
- toast.js file
- App.css file
- Choose the F5 key in Visual Studio to build and deploy the add-in.
- Use the add-inβs interface to save data as key/value pairs and to retrieve a stored value using its key.
##Troubleshooting If the add-in fails to install, ensure that the SourceLocation element in the CodeSample_PersistCustomSettings.xml has the correct URL value for the DefaultValue attribute.
- If you have any trouble running this sample, please log an issue.
- Questions about Office Add-in development in general should be posted to Stack Overflow. Make sure that your questions or comments are tagged with [office-addins].
Copyright (c) 2015 Microsoft. All rights reserved.
This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.