Office Compatibility

Hey up, received my awesome blinkstick strip and enclosure and am trying to get some VBA code working. I’ve downloaded and installed the office package, along with the blinkstick windows installer, but I can’t get it to work.

I get “Compile Error: User-defined type not defined”. Any ideas. This is Outlook 2013, 32 bit, running on 64 bit windows 8.

I have simply copied the script in your example - so nothing complex there. Just wondering if I’ve missed a setup stage?

Bryn

It’s the line:

Dim finder As New BlinkStickFinder

which is throwing the error…

Did you install BlinkStick Interop?

Also did you add reference to BlinkStickInterop? This is done in VBA editor on the main menu Tools → References…

… and adding checkbox next to BlinkStickInterop.

Doh! No, I hadn’t referenced it. It works on my PC at work now, but not my laptop which is weird. Anyway, not bothered about my laptop, so I’m happy :smile:

Next question, it’s always the first LED that comes on - can I change that to any of the others?

Bryn

Use BlinkStickIndexed or BlinkStickIndexedCSS to set colors for each LED separately. You can also use SetColors to send a frame of colors to all LEDs at once. There is an advanced sample in the Wiki utilizing this feature.

1 Like

Thank you for this, I’m being thick.

When the macro runs, it pauses the application. It unpauses when the macro has finished, but is there any way of stopping it from pausing in the first place? I locked Outlook for about 30 minutes as it ran a pulse however many times.

Great product though, I’m really loving it.

Locking out application is a bit of a problem right now, because VBA is a single threaded application. If you could find a way to put BlinkStick object into a thread from VBA, then you should be able to control it without locking up the application.

As an alternative, I may be able to implement threading inside the BlinkStickInterop. I would assume that this requires 3 essential features:

  1. Ability to call asynchronous function, which would create a thread to animate BlinkStick and exit immediately
  2. Ability to receive an event when the animation is complete so that you could start another animation if required
  3. Ability to get the current status of animation, whether it’s playing and stop it if required

It shouldn’t be a problem if you want to control one LED on the BlinkStick asynchronously, but ability to drive the animation from the VBA code with multiple LEDs may be complicated and I’m not sure yet of the approach I should take. I’m currently working on the new client application for BlinkStick and I’m facing the same issue. When I come up with a solution, I should be able to implement it in BlinkStickInterop. I would be very happy to hear if you have any suggestions or if you could explain how you are using your setup to give me some ideas on how to implement this in a most reusable way.

P.S. Glad to hear you love it! :smile: