VBA (Visual Basic for Applications) exists within Word, Access, Outlook, Publisher, and other Microsoft products, too. VBA is almost identical to Visual Basic, a common programming language for creating .exe Windows programs. But we love Excel for its myriad business uses… parsing, sorting, presenting, and storing data… so I find myself programming within Excel/VBA by default.

Think of variables (like objIE) as floating references or containers that refer to objects or numbers we want to manipulate. But before we get to use them, we have to declare, or Dim, them, which sets aside some memory for whatever kind of use we have in mind for them. To manipulate Internet Explorer as an object in VBA, we need to Dim the browser — either generically as an Object variable (an example of late binding objects), or more specifically as an InternetExplorer special object variable like we did here (an example of early binding objects).

I’ve used other automation tools besides VBA. Ubot and iMacros are both excellent, and powerful programs (their own programming languages, really). In some respects they’re easier, and for 99% of web automation tasksg, you really can’t go wrong with either. But I got to where I only used VBA because my programming was getting into Windows API’s and command line calls (Visual Basic is tightly integrated with Windows), plus I often found myself using Excel alongside these programs anyway. I discovered there’s almost nothing VBA can’t do with automating Windows and Internet Explorer (even making IE appear as a different browser), and it seemed to me investing time learning Microsoft’s Visual Basic programming language just made more sense.