Excel based addins linked to external sources via API
There two excel add-ins in this repo:
The AI_Plugin - This plugin links with ChatGPT by requring users to input their API key which can be obtained from Chat Plyaground - OpenAI API
Azure_GPT_Addin - This plugin links with AzureOpenAI by requiring users to input their API key, endpoint, deployment model and API version.
- To use the
AI_Pluginan OpenAI API key is required (create an account and get API Key at https://chat.openai.com) - To use the
Azure_GPT_Addinan Azure OPENAI service is required with an already deployed model (see here: https://azure.microsoft.com/en-au/products/ai-services/openai-service) - To modify the plugins you can use the office ribbonx editor to make changes on the xml (see here: https://github.com/fernandreu/office-ribbonx-editor")
- The JsonConverter was used to run the addin can be accessed here (see here: https://github.com/VBA-tools/VBA-JSON)
- Visual Studio Code (https://code.visualstudio.com/)
- Microsoft Visual Basic for Applications - ensure the below references are used to run, particularly the Microsoft Scripting Runtime.
This repository contains the two plugins allong with their respective sripts, the The AI_Plugin corresponds to OpenAI-CGPT script folder and Azure_GPT_Addin corresponds to AzureOpenAI script folder.
├── assets
├── plugins
│ ├── AI_Plugin.xlam
│ │
│ └── Azure_GPT_Addin.xlam
├── scripts
│ ├── AzureOpenAI
│ │ ├── modGlobals.bas
| | ├── modMain.bas
| | ├── modRibbon.xml
| | ├── modUI.bas
| | ├── modUtilities.bas
│ └── OpenAI-CGPT
| │ ├── modGlobals.bas
| | ├── modMain.bas
| | ├── modRibbon.xml
| | ├── modUI.bas
| | ├── modUtilities.bas
Lets begin with the Azure_GPT_Addin followed by the AI_Plugin
To use this addin effectively ensure to complete all the necessary settings as circled in red in the image.
- SetAPIkey : This setting would need to done prior to usage
- Set Model : This would be our Deployment Name not the actual gpt model
- Set Azure Endpoint: This will be url endpoint provided to you when deploying you application.
- Set API : This will default to 2024-02-15-preview and can be changed if this version deprecates (see here https://learn.microsoft.com/en-us/azure/ai-services/openai/reference ).
Once the settings is completed, you should select the the data to be queried and click on the Ask AI icon, The results of the query will be displayed in a separate sheet called Results.
To use this addin effectively ensure to complete all the necessary settings as circled in red in the image.
- SetAPIkey : This setting would need to done prior to usage
- Set Model: This would be the GPT model to use such as GPT-4o, note the default model is gpt-3.5-turbo which can be changed
Please be aware of the costs associated with using the OpenAI API when using this addin.
Rate limits are restrictions that OpenAI API imposes on the number of times a user or client can access their services within a specified period of time. (See for more detail https://platform.openai.com)