Skip to content

Commit 6c6ebaf

Browse files
committed
Initial commit
0 parents  commit 6c6ebaf

13 files changed

+748
-0
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
cert.pem
3+
key.pem

README.md

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# OpenAI API Formulas for Excel
2+
3+
## Usage instructions
4+
5+
1. Add the plugin to Excel by following the [sideloading instructions for your platform](https://learn.microsoft.com/en-us/office/dev/add-ins/testing/test-debug-office-add-ins#sideload-an-office-add-in-for-testing).
6+
2. Start typing the following in a formula bar `OAI.` and you should see the formulas associated with this plugin.
7+
3. For a full description of each function, see `src/functions.json`.
8+
9+
## File descriptions
10+
11+
| Path | Description |
12+
| ---- | ----------- |
13+
| assets/*.png | Icons of various sizes |
14+
| index.html | Root page loaded in the background during plugin startup. |
15+
| manifest-local.xml | A version of manifest.xml which references https://localhost:3000/ for plugin development use. |
16+
| manifest.xml | Configures where the plugin should be loaded from and what features it will make use of. |
17+
| package[-lock].json | Lists NPM dependencies. Used only during plugin development. |
18+
| functions.js | The JavaScript functions which implement the formulas. |
19+
| functions.json | The metadata which details each formula and references its implementation. |
20+
| README.md | This file. |
21+
22+
## Plugin development
23+
24+
1. Install the npm dependencies (`npm i`)
25+
2. Follow these instructions to [generate an cert-key pair](https://github.com/http-party/http-server#tlsssl).
26+
3. Run the local server (`npm start`).
27+
4. Navigate to the [root](https://localhost:3000/) in your browser and temporarily trust the newly created cert-key pair.
28+
4. Open a spreadsheet in Excel on the web and append the following query string parameters
29+
```
30+
wdaddindevserverport=3000&wdaddinmanifestfile=manifest-localhost.xml&wdaddinmanifestguid=00aeeb98-f4d9-4db0-a1e6-cdc652c08e34
31+
```
32+
5. If you are prompted to enable Excel developer mode, do so.
33+
34+
You should now be able to use the formulas as normal. If you make a change to `index.html` or `src/*`, you will need to reload the browser window.

assets/icon-16.png

841 Bytes
Loading

assets/icon-32.png

2.34 KB
Loading

assets/icon-64.png

8 KB
Loading

assets/icon-80.png

12 KB
Loading

index.html

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<script type="text/javascript" src="https://appsforoffice.microsoft.com/lib/1/hosted/office.js"></script>
5+
<script type="module" src="src/functions/functions.js"></script>
6+
</head>
7+
8+
<body>
9+
</body>
10+
11+
</html>

manifest-localhost.xml

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2+
<OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0"
5+
xmlns:ov="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="TaskPaneApp">
6+
<Id>00aeeb98-f4d9-4db0-a1e6-cdc652c08e34</Id>
7+
<Version>1.0.0.0</Version>
8+
<ProviderName>Chris Price &amp; Robat Williams</ProviderName>
9+
<DefaultLocale>en-GB</DefaultLocale>
10+
<DisplayName DefaultValue="OpenAI API Formulas for Excel"/>
11+
<Description DefaultValue="Invoke the OpenAI API calls from formula."/>
12+
<IconUrl DefaultValue="https://localhost:3000/assets/icon-32.png"/>
13+
<HighResolutionIconUrl DefaultValue="https://localhost:3000/assets/icon-64.png"/>
14+
<SupportUrl DefaultValue="https://github.com/robatwilliams/openai-excel-formulas"/>
15+
<AppDomains>
16+
<AppDomain>https://localhost:3000</AppDomain>
17+
</AppDomains>
18+
<Hosts>
19+
<Host Name="Workbook"/>
20+
</Hosts>
21+
<Requirements>
22+
<Sets DefaultMinVersion="1.1">
23+
<Set Name="SharedRuntime" MinVersion="1.1"/>
24+
</Sets>
25+
</Requirements>
26+
<DefaultSettings>
27+
<SourceLocation DefaultValue="https://localhost:3000/index.html"/>
28+
</DefaultSettings>
29+
<Permissions>ReadWriteDocument</Permissions>
30+
<VersionOverrides xmlns="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="VersionOverridesV1_0">
31+
<Hosts>
32+
<Host xsi:type="Workbook">
33+
<Runtimes>
34+
<Runtime resid="Shared.Url" lifetime="long" />
35+
</Runtimes>
36+
<AllFormFactors>
37+
<ExtensionPoint xsi:type="CustomFunctions">
38+
<Script>
39+
<SourceLocation resid="Functions.Script.Url"/>
40+
</Script>
41+
<Page>
42+
<SourceLocation resid="Shared.Url"/>
43+
</Page>
44+
<Metadata>
45+
<SourceLocation resid="Functions.Metadata.Url"/>
46+
</Metadata>
47+
<Namespace resid="Functions.Namespace"/>
48+
</ExtensionPoint>
49+
</AllFormFactors>
50+
51+
<DesktopFormFactor>
52+
<FunctionFile resid="Shared.Url"/>
53+
</DesktopFormFactor>
54+
</Host>
55+
</Hosts>
56+
<Resources>
57+
<bt:Images>
58+
<bt:Image id="Icon.16x16" DefaultValue="https://localhost:3000/assets/icon-16.png"/>
59+
<bt:Image id="Icon.32x32" DefaultValue="https://localhost:3000/assets/icon-32.png"/>
60+
<bt:Image id="Icon.80x80" DefaultValue="https://localhost:3000/assets/icon-80.png"/>
61+
</bt:Images>
62+
<bt:Urls>
63+
<bt:Url id="Functions.Script.Url" DefaultValue="https://localhost:3000/src/functions/functions.js"/>
64+
<bt:Url id="Functions.Metadata.Url" DefaultValue="https://localhost:3000/src/functions/functions.json"/>
65+
<bt:Url id="Shared.Url" DefaultValue="https://localhost:3000/index.html"/>
66+
</bt:Urls>
67+
<bt:ShortStrings>
68+
<bt:String id="Functions.Namespace" DefaultValue="OAI"/>
69+
</bt:ShortStrings>
70+
</Resources>
71+
</VersionOverrides>
72+
</OfficeApp>

manifest.xml

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2+
<OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0"
5+
xmlns:ov="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="TaskPaneApp">
6+
<Id>00aeeb98-f4d9-4db0-a1e6-cdc652c08e34</Id>
7+
<Version>1.0.0.0</Version>
8+
<ProviderName>Chris Price &amp; Robat Williams</ProviderName>
9+
<DefaultLocale>en-GB</DefaultLocale>
10+
<DisplayName DefaultValue="OpenAI API Formulas for Excel"/>
11+
<Description DefaultValue="Invoke the OpenAI API calls from formula."/>
12+
<IconUrl DefaultValue="https://robatwilliams.github.io/openai-excel-formulas/assets/icon-32.png"/>
13+
<HighResolutionIconUrl DefaultValue="https://robatwilliams.github.io/openai-excel-formulas/assets/icon-64.png"/>
14+
<SupportUrl DefaultValue="https://github.com/robatwilliams/openai-excel-formulas"/>
15+
<AppDomains>
16+
<AppDomain>https://robatwilliams.github.io</AppDomain>
17+
</AppDomains>
18+
<Hosts>
19+
<Host Name="Workbook"/>
20+
</Hosts>
21+
<Requirements>
22+
<Sets DefaultMinVersion="1.1">
23+
<Set Name="SharedRuntime" MinVersion="1.1"/>
24+
</Sets>
25+
</Requirements>
26+
<DefaultSettings>
27+
<SourceLocation DefaultValue="https://robatwilliams.github.io/openai-excel-formulas/index.html"/>
28+
</DefaultSettings>
29+
<Permissions>ReadWriteDocument</Permissions>
30+
<VersionOverrides xmlns="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="VersionOverridesV1_0">
31+
<Hosts>
32+
<Host xsi:type="Workbook">
33+
<Runtimes>
34+
<Runtime resid="Shared.Url" lifetime="long" />
35+
</Runtimes>
36+
<AllFormFactors>
37+
<ExtensionPoint xsi:type="CustomFunctions">
38+
<Script>
39+
<SourceLocation resid="Functions.Script.Url"/>
40+
</Script>
41+
<Page>
42+
<SourceLocation resid="Shared.Url"/>
43+
</Page>
44+
<Metadata>
45+
<SourceLocation resid="Functions.Metadata.Url"/>
46+
</Metadata>
47+
<Namespace resid="Functions.Namespace"/>
48+
</ExtensionPoint>
49+
</AllFormFactors>
50+
51+
<DesktopFormFactor>
52+
<FunctionFile resid="Shared.Url"/>
53+
</DesktopFormFactor>
54+
</Host>
55+
</Hosts>
56+
<Resources>
57+
<bt:Images>
58+
<bt:Image id="Icon.16x16" DefaultValue="https://robatwilliams.github.io/openai-excel-formulas/assets/icon-16.png"/>
59+
<bt:Image id="Icon.32x32" DefaultValue="https://robatwilliams.github.io/openai-excel-formulas/assets/icon-32.png"/>
60+
<bt:Image id="Icon.80x80" DefaultValue="https://robatwilliams.github.io/openai-excel-formulas/assets/icon-80.png"/>
61+
</bt:Images>
62+
<bt:Urls>
63+
<bt:Url id="Functions.Script.Url" DefaultValue="https://github.com/robatwilliams/openai-excel-formulas/src/functions/functions.js"/>
64+
<bt:Url id="Functions.Metadata.Url" DefaultValue="https://github.com/robatwilliams/openai-excel-formulas/src/functions/functions.json"/>
65+
<bt:Url id="Shared.Url" DefaultValue="https://robatwilliams.github.io/openai-excel-formulas/index.html"/>
66+
</bt:Urls>
67+
<bt:ShortStrings>
68+
<bt:String id="Functions.Namespace" DefaultValue="OAI"/>
69+
</bt:ShortStrings>
70+
</Resources>
71+
</VersionOverrides>
72+
</OfficeApp>

0 commit comments

Comments
 (0)