How to Add a Reference to the Microsoft Scripting Runtime Type Library

by Bobson St. Pierre

VBA is the default programming language used in Microsoft Office and Visual Basic on Windows platforms. VBA Makes use of self-contained reusable code referred as Objects. Before VBA makes use of an Object, it first needs to establish a reference to that object. The Microsoft Scripting Runtime Object is no different from this rule. You can set a reference to the Microsoft Scripting Runtime by using the VBA programming environment.

1

Open Microsoft Word.

2

Go to "Tools," "Macro" and then click "Visual Basic." This opens the Visual Basic programming environment.

3

Go to "Tools" and click "References." This opens the References dialog box.

4

Scroll down the list and put a check next to "Microsoft Scripting Runtime." The following is an example of how to make use of the reference:

Dim fsObject as Scripting.FileSystemObject

Set fsObject =New FileSystemObject

About the Author

Bobson St. Pierre started writing professionally in 2007 as a copywriter for his Web design firm, Bobson Consulting Corp. He keeps a blog and has written an e-book titled, "Fail your way to success!" St. Pierre holds a Bachelor of Science in computer science from DeVry University in North Brunswick, N.J.