Writing an Excel add-in using Go?

514 views
Skip to first unread message

mrec...@gmail.com

unread,
Jan 22, 2019, 10:35:24 AM1/22/19
to golang-nuts
Hi,

I was wondering if there is a library supporting writing an Excel add-in in Go. Googling did not brought anything besides the Window COM support library. Therefore, the only way I could think of so far is writing a back-end service in Go and communicating with it using 0MQ/Nanomsg/... from a C# add-in. Which would be way harder to maintain in the long run. Are there any (better) solutions around? Any help would be appreciated.

Thanks,
Marc

robert engels

unread,
Jan 22, 2019, 10:46:14 AM1/22/19
to mrec...@gmail.com, golang-nuts
What is wrong with using COM from Go ?

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

robert engels

unread,
Jan 22, 2019, 10:47:33 AM1/22/19
to mrec...@gmail.com, golang-nuts
But it also depends on what you me by add-in - if it is just processing Excel files, that’s one thing - if its a live data source I think the best way is a network bridge - that’s what we’ve used - a thin COM layer that Excel uses communicates with the process via TCP.

mrec...@gmail.com

unread,
Jan 22, 2019, 10:47:58 AM1/22/19
to golang-nuts
Nothing as such.. What I would like to write, though. Is a Excel add-in having a ribbon and UDFs. And I am not sure how or if this is possible using COM from Go.

mrec...@gmail.com

unread,
Jan 22, 2019, 10:53:41 AM1/22/19
to golang-nuts
Thanks! That's what I thought/feared..

robert engels

unread,
Jan 22, 2019, 11:15:21 AM1/22/19
to mrec...@gmail.com, golang-nuts
Depending on the nature of the plugin, it can be a much easier setup, and far more resilient. Different Excel versions get very flaky, the lifecycle of plugins can be difficult with lots of external state. By putting it is a different process it can be easier to debug, far more resilient, and efficient (the one plugin process can serve data for multiple Excel processes or sheets.

Kevin Powick

unread,
Jan 22, 2019, 10:08:44 PM1/22/19
to golang-nuts
Your scope is not entirely defined in the exchanges I've read so far, so I don't know if the following has merit, but have you considered using Excel's built in VBA and the Excel.XmlHttpRequest object to make HTTP based requests to a service written in Go?

There are several advantages, including making your Go service available to other HTTP clients, and limiting dependancies on the Excel side.

You also mention doing all of this via an Excel add-in.  If you're looking for a nice product that makes writing such add-ins very easy, check out Add-In Express.


I have no affiliation with them.  I'm just a happy customer.

--
Kevin Powick
Reply all
Reply to author
Forward
0 new messages