Skip to content

ElysionLhant/ESII-ExcelSniperII

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Excel SNIPERII (VSTO Version)

This is an Excel VSTO Add-in based on .NET Framework 4.7.2, deeply integrated with LLMs (OpenAI, Ollama, LM Studio, etc.), designed to automate Excel data processing tasks through AI assistance.

Introduction

To be honest, I believe most white-collar workers sitting in offices have been poisoned by Excel at some point. This damn software consumes at least 30% of your working hours. Yet, there is very little meaningful work involved. Most of the time, we are just adjusting formats, tweaking fonts, and tweaking all sorts of things.

In order to make unstructured data structured while keeping it aesthetically pleasing for people other than the Excel processor to view, we often have to pay several times the effort of the content itself, and that content often has no meaning, at least to the person processing the Excel. The effort spent on processing these garbage files and formats is something the author of this tool does not possess, and even if I did, I wouldn't want to waste it on work.

Therefore, this plugin was born. Excel Sniper II.

The function of this tool, in general, is to let the LLM handle those meaningless copy-pasting, formula writing, and format modifying tasks for you. By creating an intuitive human-machine collaboration workflow, let the LLM handle those dirty and tiring jobs.

Rest assured, the author does not intend for you to repeatedly talk to a ChatUI inside a tool for half a day, then copy-paste and go to the next window to continue. That is the existence value of Copilot, not this tool.

This tool allows you to customize and save your Prompt wording for data filling, and can also let the LLM write custom VBA macros for you or even heal VBA macros, and preserve all your work results for use next time. In this way, every time you use this tool, you are forging your own silver bullet against the greedy vampire that is office affairs. Then use the LLM as your weapon to shoot dead those repetitive tasks.

You can equip different LLMs for different functional components to maximize effectiveness. At the same time, you can run software like Ollama, LM Studio, etc. on your local computer to provide LLM services, so you can also save on Microsoft Copilot's subscription fees. This makes your data more secure.

You can select an area like operating an RTS game, and then click your custom action to make the data become what you want.

The inspiration for the name of this plugin comes from the mass-produced machine GM Sniper II in the author's favorite Gundam work.

Features

  • Multimodal Input: Supports screenshots, text, and file drag-and-drop. AI can "see" your Excel selection.
  • Smart Fill: Generated data is automatically filled back into Excel, supporting automatic row/column expansion without manual pasting.
  • Data/Image Dual Mode:
    • Data Write: Focuses on vision-based form filling and generation.
    • Data Op: Focuses on VBA-based complex data cleaning and operations.
  • Macro Library: Solidify common AI operations into macros, building your private automation arsenal.

Scenarios

Scenario Traditional Copilot / Manual Sniper II Workflow
Unstructured to Structured Manually typing data from images, or fixing formats after OCR Screenshot -> Generate. AI looks at the image and fills the table directly, in one step.
Complex Data Cleaning Searching Google for Excel formulas, debugging for half an hour Input Command: "Mark all values greater than 100 in column A as red, and extract Japanese from remarks to column C".
VBA Writing Open editor, write code, error, check docs, debug again Input Command -> Run. Error? AI fixes it automatically, run again.

Advanced Configuration & Macros

1. Comprehensive Settings & Management

  • New Settings Window: A dedicated window for managing all configurations.
  • Prompt Management:
    • Add and save custom Prompt presets.
    • Use the "🗑" button to clear the current prompt text box (does not delete the preset).
  • Macro Management:
    • Local Macros: Manage and persist common VBA macro codes.
    • In-File Macros: Automatically read and run macros from the active workbook.
  • Advanced LLM Configuration:
    • Simple Mode: Use a single global LLM configuration for all tasks.
    • Advanced Mode: Configure different LLM providers/models for specific tasks:
      • Header Detection: Requires a Multimodal model (Vision capable).
      • Data Write: Requires a Multimodal model (Vision capable).
      • Data Operation: Text-only model is sufficient (Code Generation).
      • VBA Self-healing: Text-only model is sufficient.
    • Local Model Support: Built-in detection for local Ollama and LM Studio instances.
    • Provider Support: OpenAI, Ollama, LM Studio.

2. Macro Library & Smart Self-healing

  • Streamlined UI: The code editor and management buttons (Save/Del) are hidden by default. They automatically appear when a new macro is generated via Data Op mode.
  • One-Click Run: Execute selected macros directly without opening the VBA editor.
  • Smart Self-healing:
    • When a macro fails, AI analyzes the error log, code intent, and current workbook context (e.g., Sheet names).
    • Automatically generates fixed code and saves it as a new macro.
    • Note: If the VBA Editor window pops up due to a syntax error, please close it manually to allow the plugin to proceed with the AI repair process.
  • Persistent Storage: Macro code library is saved locally.

Tech Stack

  • Framework: .NET Framework 4.7.2, VSTO
  • Language: C#
  • UI: WPF (Modernized UI)
  • Network: HttpClient (TLS 1.2)
  • Data: JSON Serialization

Installation & Run

Option 1: Release Version (Recommended for Users)

  1. Download: Get the latest ExcelSP2_Release.zip from the GitHub Releases page.
  2. Unzip: Extract the zip file to any folder.
  3. Install: Run setup.exe.
  4. Done: Open Excel, and the add-in will be loaded automatically.

Option 2: Source Code Build (Recommended for Developers)

  1. Prerequisites:
    • Windows OS
    • Visual Studio 2019+ (with "Office/SharePoint development" workload)
    • Microsoft Excel
  2. Open Project:
    • Open ExcelSP2.sln.
  3. Build & Run:
    • Press F5. Visual Studio will build and start Excel.

Important: Macro Configuration (For All Users)

To allow the plugin to generate and execute VBA code, you must enable permissions in Excel:

  1. Go to File > Options > Trust Center > Trust Center Settings > Macro Settings.
  2. Check Trust access to the VBA project object model.
  3. Click OK to save.

User Guide

For a detailed explanation of all features, please refer to the User Guide.

  1. Configure Settings: Click "Settings" to open the configuration window.
    • Use "Detect Local Models" if you have Ollama/LM Studio running.
    • Choose "Simple" or "Advanced" mode to configure your LLM providers.
  2. Capture Data: Select data in Excel and click "Capture".
  3. Select Mode:
    • Data Write: For filling/cleaning cells.
      • Reference Existing Data (Checked): Sends screenshot & data. Best for cleaning/correction.
      • Reference Existing Data (Unchecked): Sends headers only. Best for fresh generation.
    • Data Op: For complex operations via VBA generation (Reference option hidden).
  4. Add Context: Drag files or paste images into the input area.
  5. Generate: Click "Generate & Fill" (or "Run" in Data Op mode).

FAQ

  • API Error?: Check API Key and Base URL in Settings. Ensure local models are running if used.
  • Macro Error?: Enable "Trust access to the VBA project object model" in Excel.
  • Vision Tasks Failing?: Ensure you are using a Multimodal model (e.g., gpt-4o, llava) for Header Detection and Data Write.

Support

If you feel that Excel SniperII has truly helped you, allowing you to customize your own weapon instead of Microsoft's water pistol, feel free to buy me a coffee.


"To the Philosopher King killed by the Assassin's Creed, Edward Kenway."

About

The Silver Bullet for Repetitive Toil. Injecting LLM cognition into Excel to construct a "WYSIWYG" automation sniper nest.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages