I spend a fair amount of time writing code in C#, which I enjoy. I occasionally wish I could use C# inside other applications. One application where I

QueryStorm | C# in Excel

submited by
Style Pass
2023-01-25 10:00:09

I spend a fair amount of time writing code in C#, which I enjoy. I occasionally wish I could use C# inside other applications.

One application where I think C# would fit right in is Excel, as a replacement for VBA. VBA is a bit (a lot) behind the times and Microsoft isn’t planning on upgrading it. Instead, they’re offering a sandboxed JavaScript environment called Office Scripts.

Since Microsoft won’t be doing it, I figured I might have a crack at it. After all, with Microsoft committed to JavaScript, it’s unlikely they will muscle me out of the lucrative C# in Excel market.

I call it QueryStorm. I started working on it way back in 2014. It originally had just SQL support, and I’ve continued working on it ever since, gradually adding support for C# scripting, custom C#/Excel functions, NuGet support, a debugger, and even an app store!

QueryStorm uses AvalonEdit as its code editor. AvalonEdit is a fancy textbox that can show text with rich formatting, but it doesn’t know anything about the C# language and its syntax. It needs to be told where symbols and errors are located in the text (so it can highlight them), which autocomplete options to offer, etc.

Leave a Comment