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.

I have used FileSystem Object in my code and it relies on the user having turned on his Microsoft Scripting Runtime Library. Is there a code by which I can turn on this library on the user's Excel application?
Microsoft Scripting Runtime

2 Answers
you can use this way:
Check if Scripting is not activated in references of the VBAproject then add it otherwise do nothing
@Vasily's answer works, but a user will still have to enable the option Trust Access to the VBA Project object model in excel or any other microsoft office program.
File ->Options ->Trust Center ->Trust Center Setttings ->Macro Settings ->Trust Access to the VBA Project object model
Comments are closed.