Excel Add-in Development

Excel add-in development
from macro workbook to deployable tool

I help you decide whether your macro workbook should become an add-in, which technology fits, and I build the first working version.

This page is for business departments and small software vendors whose Excel solution has grown: many macros, several users, copies of the file in different versions.

I am a mechanical engineer (BSc, ZHAW) and have worked in PLM and CAx for more than 10 years, where I built over 20 automation tools with Visual Basic, NX Open and PowerShell. I work part time as an independent freelancer from Wetzikon near Zurich, in mini-projects and clearly scoped work packages, on site in German-speaking Switzerland or remotely across the DACH region. My add-in work with C# and VSTO so far consists of proofs of concept and architecture work, not a finished shipped product.

A reasoned technology choice

XLAM, VSTO, Excel-DNA or Office.js: I rate the options for your case by deployment, maintainability, IP protection and security.

Proof of concept, not paper

A small working add-in shows early whether the ribbon, the installation and IT approval work in your environment.

Migration in stages

An existing VBA application can be moved to C# module by module, so the business logic stays traceable and testable.

When a macro workbook should become an Excel add-in

As long as one person works with one file, an .xlsm workbook with macros is perfectly fine. It gets difficult when code and data live in the same file and that file is copied. Every copy then carries its own version of the code, and a fix only reaches the files someone updates by hand.

  • Many users: everyone works with the same version, whichever file they open.
  • Updates: a new version is rolled out once instead of being copied into every workbook.
  • IP protection: the code is no longer openly included in every file you hand over.
  • IT approval: an installable add-in can be reviewed, inventoried and removed. Macros inside files are blocked in many companies.

VSTO, XLAM, Excel-DNA or Office.js: choosing the technology

I list Office.js as an option because it is the only route for Excel on the web, and on Mac the only one besides VBA, which runs there with restrictions. I have not delivered a project with Office.js so far.

  • XLAM (VBA): quickest to build, existing code can be reused, deployed as a single file. Code protection is weak, and company macro policies can block the add-in.
  • VSTO (C# on .NET Framework): native ribbon, a proper development environment, tests and version control as in any software project. Needs an installation with runtime components and runs only in Excel for Windows.
  • Excel-DNA (XLL): .NET code as an .xll file, without the VSTO runtime and with lightweight deployment. A good fit for custom worksheet functions, the ribbon is defined in XML.
  • Office.js (web add-in): runs on Windows, Mac and in the browser and is deployed centrally through Microsoft 365. Access to Excel is narrower than through the classic object model, and the add-in needs hosting.

What I have built as proofs of concept or designed as a concept

The following work comes from a project for an Excel-based specialist tool intended for a public-sector organisation with strict IT security requirements. I did it as part of a small project team. It was feasibility and architecture work for the path from VBA prototype to product.

  • A VSTO add-in in C# with a native ribbon, a bilingual interface (German and English) driven by language files, built-in help and per-user settings.
  • A minimal add-in packaged as a per-machine MSI: prerequisite checks, registration for 32-bit and 64-bit Excel, and an uninstall routine.
  • A VBA add-in as .xlam with its source kept as .bas files under Git, plus a study on protecting VBA code.
  • As a concept, not implemented: roles and sheet protection inside a plain workbook, without a server. Intended as governance, not high security.

Migrating VBA to C#, module by module

A mature VBA application holds years of domain knowledge. Rewriting it in one go is risky, because nobody remembers every special case. For the project above I therefore designed an architecture that splits the application into functionally separate modules.

The plan is to move each module to C# on its own and check it against the behaviour of the VBA original.

Project examples in Excel add-in development

The examples are anonymised and describe proofs of concept, not shipped products.

From VBA prototype to product: four add-in architectures compared

Specialist Excel tool, public sector, Excel for Windows

Situation
A mature VBA prototype was to become a maintainable product that can be handed to others without exposing the code.
Approach
I compared VSTO, XLAM and two Excel-DNA variants, some with and some without additional code protection, and rated them on feasibility, maintainability, deployment, IP protection, attack surface and licensing.
Result
A decision basis with a rating per variant, and a working VSTO add-in as evidence for the target architecture.

Deploying an Excel add-in in locked-down IT with an MSI installer

Public-sector organisation with strict IT security requirements

Situation
IT will not approve an add-in unless it knows what the add-in changes on the machine and how it is removed again.
Approach
An add-in with no business function, packaged as a per-machine MSI with prerequisite checks, registration for 32-bit and 64-bit Excel and an uninstall routine. A before and after comparison of the registry shows what the installation writes.
Result
A package with an uninstall routine and documented system changes, as a basis for approval.

Protecting VBA code and versioning it with Git

VBA add-in (.xlam)

Situation
VBA code sits in the file in binary form. Changes are hard to compare, and the project password does not seriously stop anyone.
Approach
The source is kept as .bas files under Git and imported into the add-in by script. For protection I compared obfuscation with compiling to a native DLL, combined with a licence key.
Result
A traceable development workflow for VBA and a comparison of the protection options with their limits.

Frequently asked questions about Excel add-ins

VSTO, XLAM, Excel-DNA or Office.js: which one fits my Excel tool?

It depends on who uses the add-in and how it is deployed. For a few users with existing VBA code, an XLAM is often enough. If the tool has to be maintained, protected and approved by IT, VSTO or Excel-DNA is the stronger choice. Office.js comes into play when Mac or Excel on the web is a requirement.

Can VBA code really be protected?

Only to a degree. The password on a VBA project is not serious protection. Obfuscation makes the code hard to read, and moving the logic into a compiled DLL raises the bar considerably.

How is an Excel add-in deployed in a company?

An XLAM can be provided through a shared folder or software distribution. A VSTO add-in is usually installed as a per-machine MSI, with checks for the runtime components and registration for 32-bit and 64-bit Excel. Web add-ins are assigned centrally through Microsoft 365 administration.

Does a VSTO add-in run on Mac or in Excel on the web?

No. VSTO add-ins run only in Excel for Windows on the desktop, and so does Excel-DNA. An XLAM runs on Mac with restrictions. For Excel on the web, Office.js is the only option.

Can existing VBA be migrated to C#?

Yes, but not automatically. The code is rewritten module by module and checked against the original. It makes sense when the application should live for years, be tested and be maintained by several people.

How do I start with a proof of concept?

With a small first step of fixed content, for example an add-in with a ribbon and an installer on your target environment. I state the effort in the quote.

Related services

Should your Excel tool become an add-in?

Tell me about your workbook, the number of users and your IT requirements. I will tell you which option I would evaluate first.

Send enquiry