What is References (Tools References) in VBA

 Hello Readers,

Welcome to Coding by Learning !!! ๐Ÿ˜€ 

This is one of the important part of VBA programming

We know VBA editor is available by default in all MS-office applications. Lets take excel as an example.

Every excel workbook has VBA editor. We can view this by navigating Developer -> Visual basic Or by short cut Alt + F11

Now this VBA editor is from excel so we can write any VBA code for automating excel activities. 

But when you want to automate any other office applications or any external applications (Like Webpage, SAP, Mainframe..etc) from excel VBA, then this “References” feature comes into picture

In this example I am going to connect Ms-Word with my excel VBA code

Navigate Tools -> References










Select Microsoft Word 16.0 Object library
















Now you can see I am getting intellisense for MS-Word







Like wise you can connect any MS-office or External applications to VBA code using References libraries.

Note : To add references to code, there are 2 things important. Firstly the external application should be installed in your system. for example if my system does not have outlook installed then I cannot get Outlook in the references. Secondly the references dlls should be available (Mostly it will be available, if not there then it should be added under C:/windows/System32 folder)

Happy learning & Happy coding!!!

Comment and share this post to your friends and colleagues ๐Ÿ˜€

Comments

Popular posts from this blog

VBA Interview Questions - Part 2 - Variables and Data types

VBA Interview questions - screen updating

VBA Interview questions - Part 3 - Array concept