Describe sample functionality, DELETE_EXAMPLE: This sample shows how to insert an existing template from an external Excel file into the currently open Excel file. Then it retrieves data from a JSON web service and populates the template for the customer.
- DELETE_Features of this sample: which APIs are used, what service is called....
- DELETE_EXAMPLE: Use insertWorksheetsFromBase64 to insert a worksheet from another Excel file into the open Excel file.
- DELETE_EXAMPLE: Get JSON data and add it to the worksheet.
- Node.js (the latest LTS version). Visit the Node.js site to download and install the right version for your operating system. To verify if you've already installed these tools, run the commands
node -v
andnpm -v
in your terminal. - Visual Studio Code and Office Add-ins Development Kit version 0.5.0 and higher.
- Office connected to a Microsoft 365 subscription. You might qualify for a Microsoft 365 E5 developer subscription through the Microsoft 365 Developer Program, see FAQ for details. Alternatively, you can sign up for a 1-month free trial or purchase a Microsoft 365 plan.
The simplest way to run this add-in project is using the Office Add-ins Development Kit. The Office Add-ins Development Kit is an end-to-end developer tool for building Office Add-ins. You can use this tool to easily creating, running and debugging an Office Add-in.
-
Download the sample code
Clone or download this sample to a folder on your computer, then open the folder in Visual Studio Code.
-
Install the Office Add-ins Development Kit
Install the Office Add-ins Development Kit extension in Visual Studio Code marketplace. Click the button in the side panel to open the extension.
-
Preview Your Office Add-in (F5)
Select
Preview Your Office Add-in(F5)
to start debugging the add-in code.After selecting the button, the extension will first check prerequisites before debugging starts. Check the terminal for detailed information and guidance to get the environment ready. After this process, a Word/Excel/PowerPoint desktop app will launch with the add-in sample side-loaded.
-
Stop Previewing Your Office Add-in
After you complete the debugging process, select
Stop Previewing Your Office Add-in
to stop debugging.
- To debug on Office on the web, go to Sideload Office Add-ins to Office on the web
- To debug in Desktop (Edge Legacy), go to Debug Edge Legacy Webview
- If you meet sideload errors, please check the following items to avoid some common errors:
-
You have installed dependencies.
-
You have closed all Word/Excel/PowerPoint apps.
-
You have stopped your last add-in previewing session.
If you still have problems, check troubleshoot development errors or Create an issue and we'll help you out.
-
You can try out the sample add-in when it's sideloaded on Word/Excel/PowerPoint apps:
- DELETE_EXAMPLE: Put the steps about how to use this sample.
- DELETE_EXAMPLE: Register an API key in XXXXXX
- DELETE_EXAMPLE: Replace the API key in xxxxx.js
- DELETE_EXAMPLE
To explore the components of the add-in project, review the key files listed below.
You can check whether your manifest file is valid by selecting Validate Manifest
in the Office Add-ins Development Kit
extension tree view.
DELETE_THIS_LINE:Use copilot chat @workspace to generate folder structure
| .eslintrc.json
| .gitignore
| .vscode/
| | extensions.json
| | launch.json Launch and debug configurations
| | settings.json
| | tasks.json
| assets/ Static assets like image/gif
| babel.config.json
| manifest.xml Manifest file
| package.json
| README.md Get started here
| RUN_WITH_EXTENSION.md Run the add-in with Office Add-ins Development Kit extension
| SECURITY.md
| src/ Add-ins source code
| | commands/
| | | commands.html
| | | commands.js
| | taskpane/
| | | taskpane.css Task pane style
| | | taskpane.html Task pane entry HTML
| | | taskpane.js Add API calls and logic here
| webpack.config.js Webpack config
GitHub Copilot extension for Office Add-ins:
DELETE_THIS_LINE: Only include in projects generated by GitHub Copilot extension.
-
Type in
@office
to invoke the extension. -
Type in
/generatecode
and describe the feature you would like to build, then send the request to Copilot. -
Get the response from the extension and use the code.
Resources to learn more Office Add-ins capabilities:
- Select
View Samples
onOffice Add-ins Development Kit
tree view for real-world examples and code structures. - Read the documentation of Office Add-ins.
Did you experience any problems with the sample? Create an issue and we'll help you out.
Want to learn more about new features, development practices, and additional information? Join the Microsoft Office Add-ins community call.
Copyright (c) 2024 Microsoft Corporation. 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.
Note: The taskpane.html file contains an image URL that tracks diagnostic data for this sample add-in. Please remove the image tag if you reuse this sample in your own code project.
THIS CODE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.