If The Shoe Fits...

I am in Italy for a part time gig and I often have very little I can support the team with and usually just sightsee so I was expecting to be bored most of this time too. This trip was different... They needed help with something code based, yay! They have an Outlook macro that went belly up with the Windows 10 upgrade and have been living without it for a long time.

 I can do that!

I can do that!

Oh VBA... wait VBA? Hmm... 

Visual Basic for Applications (VBA) in case your lost on the accronym. I thought to myself it could end up in a disaster but then again if I fix their problem I am a champ! Challenge accepted! I looked into the code a bit and knew I had some reading to do but at first glance the code looked familiar like all the other languages I've ever done (age old adage, once you know how to code in one language they all start to look similar). Initially I had problems since I didn't have access to the internet so it was a bit like playing pin the tail on the donkey except I didn't know I was playing a game or the goal of the game!

I finally was able to access the internet which allowed me to start doing research and get familiar with the VBA syntax. Then I got distracted. I started to ask myself, there has to be a better way than this VBA crap (I was getting frustrated with the syntax!) I did some research and found I could do something in PowerShell or create an Add-In for Outlook but then I stopped myself as 75% of the code was already written and it'd be a waste of my time to rewrite something that worked in the past. So back to the grindstone...

sharon-pittaway-117630-unsplash.jpg

Then it hit me!

When the shoe fits...

That ah hah moment! It doesn't matter about the language used, it matters if it's the best language for the task at hand. If the shoe fits... put it on! VBA and the Microsoft application API can do some crazy stuff I had no clue about before. I was actually having fun with it and reading about all the crazy stuff you can do to interact within an application and with others.

allthefiles.gif

 

In the end I was able to not only fix the issues but also extend the macros features. Nothing special really, they were manually entering their emails into the macro code along with a few other tedious things that I figured were automatable. If I have time I will see about adding some more features such as an error log and other minor items that will help other devs in the future.

I am curious have you ever approached a language with a eye of dislike and been suprised at what you found?