Read the very first line in comments in the code that i posted above

You need to set reference to Microsoft Scripting Runtime Library

Click On Menu project=>References and select the Microsoft Scripting Runtime Library