See a Need, Fill a Need

I’ve been fairly absent from this blog lately. I’ve been busy working on a new release of Rubberduck and, honestly, there are only so many hours in a day. More importantly, there are only so many concentrated thoughts to go around in 24 hours. So, I apologize for being gone for so long. I hope you can forgive me when you see the results. I’m really excited about our next release. There’s some really awesome things in there. You can download the pre-release now if you’re interested. There are a few kinks to work out, but things should be stable very soon.

To be truthful though, that project is the last thing I want to talk about right now. Rubberduck has become an obsession. There have been so many early mornings and late nights that I can’t possibly count them. There will be more. Many more. We’re only getting warmed up… and I’m going to talk about it anyway. It is an obsession after all. Like any addict, I just can’t let it go.

Continue reading

Registering a COM Add-In with InstallSheild LE

I’m taking a quick time out from getting Version 1.2 of Rubberduck ready to talk a little bit about working with COM Add-Ins and Installshield’s installer builder. (Awkward phrase, I know.) First, let me say that I’m not impressed with InstallShield LE, not even a little bit. As awkward as that phrase was, this tool is so much worse. Granted, it could be that it’s a great tool and I’ve just not tried the alternatives yet… but I doubt it. Something out there has to be better. When I find it, I’ll let you know.

I’ve digressed though. I’m here for a reason. I fight with this setting in the installer each and every time I build a new version. Enough is enough. This is my documentation. You see, I spent a few days creating a new installer. The installer would build without error and install without error, only for me to receive a

Could not load the add-in.

message upon opening the VBA IDE. It’s incredibly frustrating, but here’s how to do it right.

When creating an add-in for the VBA Editor, or any MS Office application really, you have to register the assembly for COM Interop. Most of the blogs and tutorials out there show you how to do this with Regasm or Visual Studio. That’s fine for development, but if you want any one else to ever actually use your software, you’ll probably need to create an MSI package and/or a Setup.exe. That program will need to register the assembly on the target machine.

Go to the Project Assistant, and then to the Application Files screen. You’ll need to take a couple of Actions here to properly create the installer. Obviously, you’ll need to add the Primary Output. What’s not so obvious is that you’ll also need to manually link the *.tlb file by selecting installation folder, then the Add File button, and pointing to the file in your \bin\Release directory.

Adding tlb file

The second not so obvious (and most frustrating) thing is you’ll need to set the properties on the assembly correctly. So, right click on the Primary Output, and select Properties. In the dialog, go to the COM & .Net Settings tab. Once you’re there, use the settings below.

  • Extract COM Information
  • Scan at Build == Dependencies and Properties
  • Check the COM Interop box.

  • InstallSheild LE COM Settings

    Now when you build the Assembly & Installer and then install, your COM Add-in will properly load. There’s a little more to getting your installer perfectly right than that, but I’m short on time and that hidden property is what tripped me up for the last few days. So, hopefully I’ve saved some one some pain. Even if that someone is me a month from now.

    Until next time, Happy Coding.

    2014 In Review – Obligatory Look Back at the Year Post

    The stats helper monkeys prepared a 2014 annual report for this blog and it’s pretty interesting to see. I keep an eye on the site stats, but the graphics are pretty. (I like fireworks, what can I say?) It’s a nice reminder to me of what you’re all interested in hearing from me. People seem to like the progress bar I built, and are interested in using source control for their VBA projects. So, I suppose it’s time I bit the bullet and built a progress bar that can be used in any of the Office Apps, instead of just Access, and started work on Rubberduck’s Git Integration.In reality though, these are small things. This blog is a small thing. These stats are nice, but life is so much bigger than some numbers about a blog.

    This year I married the love of my life. She’s the most wonderful thing that could happen to such a schmuck. How she tolerates me spending my time working on projects like this and Rubberduck after hours will forever remain beyond my grasp. I know you’re not reading this darling, but just in case you decide to read my drivel on a lark, I want to thank you. You rock.

    I want to thank you, my readers, too. You all rock like a bunch of fraggles as well. If you weren’t reading this, I wouldn’t keep doing it. I hope you all had a great 2014 and have an even better 2015 in store.

    Here’s an excerpt:

    A San Francisco cable car holds 60 people. This blog was viewed about 1,900 times in 2014. If it were a cable car, it would take about 32 trips to carry that many people.

    Click here to see the complete report.

    Setting Up a Debug Environment for VBA

    VBA supports Conditional Compilation. Most often this is used to switch between different methods based on whether the installed version of Office is 32 or 64 bit, but it can also be used to set up a kind of debugging environment. Today we’ll take a look at what exactly conditional compilation is, and how to leverage it to make our programs behave differently while we’re developing. Continue reading

    A Better Visual Studio for the Little Guy: First Impressions of Visual Studio Community

    I suppose that you’d have to be living under a rock if you haven’t heard by now, but Microsoft just announced some pretty big news. No, I’m not talking about how they just open sourced the .NET framework. I’m talking about the new free Visual Studio offering, Visual Studio Community.

    This isn’t just a rebranded Express. No, this is a full fledged IDE friends. There will be no more needing multiple versions of VS in order to build both web and desktop apps. This one does it all.

    This also isn’t just all of the different Express versions rolled into one either. In Scott Hanselman’s words, “This is practically Pro.” Community lets you start a process when the debugger starts, rather than attach it after the fact. That seems like a little thing, but trust me, it’s not. I’ve been working on a COM add in recently and this has saved me 3 or 4 clicks every time I need to step through some code. Community also gives you a full stack trace and exception information at the tips of your fingers. It helped me track down a bug in minutes that had been driving me mad for a week.

    VS Community is available for free to open source developers, for educational purposes, and companies with 5 or less developers. I really can’t recommend it enough. If you’re using Express, go get yourself a copy of Community. I’m sure I’ve not even really scratched the surface on what Community can do that Express can’t, so leave a comment with the best “new” features you’ve found.