OfficeDev/Excel-Add-in-SalesLeads

Name: Excel-Add-in-SalesLeads

Owner: Office Developer

Description: Shows how to create worksheets and tables, hide worksheets, sort tables, use conditional table formatting, create charts, add trendlines to charts, hide gridlines, include hyperlinks from one table to another, and convert the workbook to a byte array.

Created: 2018-01-10 21:16:05.0

Updated: 2018-03-01 07:52:14.0

Pushed: 2018-02-14 23:37:50.0

Homepage: null

Size: 2406

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Excel Add-in that supports data import and data analysis

Shows how to create worksheets and tables, hide worksheets, color worksheet tabs, freeze table headers, sort tables, use conditional table formatting, create charts, add trendlines to charts, hide gridlines, include hyperlinks from one table to another, and convert the workbook to a byte array.

Table of Contents
Change History
Prerequisites
Get started
  1. Install the prerequisites above.
  2. Install the NPM Package Manager for Visual Studio from NPM TaskRunner.
  3. Clone this repo.
  4. Open a Node-enabled system prompt (or git bash) in the root folder of the Excel-Add-in-SalesLeadsWeb project (one level down from the root of the solution).
  5. Run npm install. This will install babel and WebPack.
  6. Open the *.sln file in the root of the project in Visual Studio.
  7. In Visual Studio, select View | Other Windows | Task Runner Explorer.
  8. In the Task Runner Explorer, open package.json and Custom.
  9. Right-click build, and then in the context menu, select Bindings | After build.
Build and Test
  1. Press F5 to start the add-in.
  2. Open the add-in from the Sales Leads button on the Home ribbon.
  3. On the taskpane, click Import Data. Two worksheets are created named Opportunities and Customers. Note that for both worksheets, the tabs are colored red and the top row remains visible if you scroll down in the worksheet.
  4. Select a cell with the name Sally Jump on the Opportunities sheet. (This is the only salesperson with enough data to make a meaningful analysis.)
  5. Press Analyse. A Report worksheet is created. Note that:
    • Its gridlines are hidden.
    • The table at the top contains the sales leads for the salesperson “Sally Jump” taken from the Opportunities worksheet.
    • The column of customers in the table are hyperlinks to the customer's contact info in the Customers worksheet.
    • The Expected Value column is conditionally formatted with a color scale, so that the lead with the highest potential value is red, the lead with the lowest is blue, and other leads other leads are mixtures of red, blue, and yellow depending on how close they are to the highest and lowest potential values.
    • The chart shows the sales in 2016 of the salesperson “Sally Jump”.
    • The chart has a trendline showing the trend of the salesperson's sales in 2016.
  6. Press Get File as Base 64 String. After a few seconds, a long base 64 string will appear in a textbox on the taskpane. To verify that this is the file, copy and paste the string to a website where you can decode and download it as an *.xslx file, such as https://www.base64decode.org/.
  7. Open the downloaded file. It should be identical to the file on which you are running the add-in.

Note: The Download Report button is intended only to illustrate a possible enhancement. It is not implemented.

Questions and comments

We'd love to get your feedback about this sample. You can send your feedback to us in the Issues section of this repository.

Questions about Microsoft Office 365 development in general should be posted to Stack Overflow. If your question is about the Office JavaScript APIs, make sure that your questions are tagged with [office-js] and [API].

Additional resources

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Copyright

Copyright (c) 2018 Microsoft Corporation. All rights reserved.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.