How to Add a Reference to the Microsoft Scripting Runtime Type Library (4 Steps)

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.

Step 1

Open Microsoft Word.

Step 2

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

Step 3

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

Step 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