Speckle Excel in VBA Macro subroutine

Hi Speckle-users!
I would like to run a VBA macro in Excel that could run the Speckle Excel add-in. So basically automatically add / remove data and consequently push the data to the server. Anyone knows if this is possible? TIA!

  • Edwin

Hey Edwin, welcome!

Let me try to understand a bit better what you’re doing :confused:

  1. are you using this Excel plugin?
  2. or are you trying to use VBA to send/receive stuff in your sheet?

If (1), that connector is still work in progress, but we can ping its author (Mish) and he might be able to help.
If (2), I’m afraid what you can achieve with VBA is a bit limited… You should be able to send / receive via normal http calls (or with a REST library), but probably wouldn’t be able to use any socket notifications (real time updates)…

Hope it helps!

1 Like

Hi! Thanks a lot for your swift reply!
My answer to (1) is yes, I am using that Excel plugin. If its author could help out, that would be great!

Just a bit more background what I am trying to achieve. I run a macro to populate an Excel sheet. Once the sheet is populated, I want to send this to the Speckle server. Currently it only involves 3 mouse clicks to use the plugin manually, so not the end of the world. But it still breaks up the subroutine, so it’d a nice feature if that could be avoided.

1 Like

I’m afraid that last auto send step will still need manual input in 1.0 :confused:

@mishaelnuh just started his PhD at Cambridge so he won’t be able to look at this anytime soon, and this would be more relevant to implement in 2.0 anyway! This is good feedback for us! We always saw excel as a bit of a curated step, and didn’t consider automatic sending for it.

You could try the scripting way, as @teocomi mentioned, but it might be a bigger pain than those 3 clicks * 100 times! (I personally dislike VB :rofl:)

1 Like

Hey! Just gonna quickly jump in with a comment. I’m not sure if this is technically feasible; the Speckle Excel plugin is written using the Office JavaScript API which is really just a webpage that Excel hooks into and is mostly sandboxed in the browser inside of Excel itself. A quick Google search shows there’s no a way to interact with it from VBA macros. As a note, it may be possible to do this using the outdated COM or VSTO plugin framework for 2.0.

3 Likes

Thanks @teocomi and @mishaelnuh for you replies. By the sounds of it I will just stick to the manual 3-click method for the time being, rather than trying to find a more complex way. Hopefully in 2.0 I will be able to make use of this feature :slight_smile:

1 Like