# Matlab Use Spreadsheet Link

Exchange data between Excel and MATLAB using Spreadsheet Link VBA macros and worksheet...

- Repository: https://github.com/matlab/matlab-agentic-toolkit (1237 stars)
- Category: Documents
- License: see repository
- Last updated: 2026-10-27
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add matlab/matlab-agentic-toolkit --skill matlab-use-spreadsheet-link -g -a claude-code -y`
Codex: `npx skills add matlab/matlab-agentic-toolkit --skill matlab-use-spreadsheet-link -g -a codex -y`
Cursor: `npx skills add matlab/matlab-agentic-toolkit --skill matlab-use-spreadsheet-link -g -a cursor -y`
Gemini CLI: `npx skills add matlab/matlab-agentic-toolkit --skill matlab-use-spreadsheet-link -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add matlab/matlab-agentic-toolkit`

## Description

Exchange data between Excel and MATLAB using Spreadsheet Link VBA macros and worksheet functions. Use when writing Excel VBA macros that call MLPutMatrix, MLGetMatrix, MLPutVar, MLGetVar, MLPutRanges, MLEvalString, MLGetFigure, or MatlabRequest.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Spreadsheet Link

Spreadsheet Link connects Excel to MATLAB, enabling users to exchange data between Excel and MATLAB, run MATLAB commands, using MATLAB as the compute engine from Excel.

## When to Use

- User wants to export Excel data into MATLAB workspace variables
- User wants to import MATLAB variables back into Excel cells or VBA variables
- User wants to execute MATLAB commands from an Excel VBA macro or worksheet cell
- User wants to import MATLAB figures into Excel as images
- User is building a workflow that uses Excel as the data interface and MATLAB as the compute engine

## When NOT to Use

- MATLAB-only workflows with no Excel involvement
- Python or .NET integration with MATLAB (use MATLAB Engine API instead)
- Deploying MATLAB as a web service (use MATLAB Production Server instead)

## Architecture

Spreadsheet Link uses VBA macros or worksheet functions in Excel to communicate with a locally running MATLAB instance via COM.

```
┌─────────────────────┐         VBA / COM          ┌─────────────────────┐
│   Excel             │  ◄─────────────────────►   │  MATLAB             │
│   (VBA or cells)    │                            │  (workspace)        │
└─────────────────────┘                            └─────────────────────┘
```

- Windows only (requires MATLAB COM Server)
- MATLAB must be running locally
- Two usage modes: VBA macros or worksheet functions (cell formulas)
- Two data exchange styles: range-based (MLPutMatrix/MLGetMatrix) or VBA-variable-based (MLPutVar/MLGetVar)

## Key Functions

The rest: https://github.com/matlab/matlab-agentic-toolkit/blob/HEAD/skills-catalog/computational-finance/matlab-use-spreadsheet-link/SKILL.md
