How To get CreateObject("Scripting.FileSystemObject") work properly on computers without VB installed??

Hi!!

I use CreateObject("Scripting.FileSystemObject") commands in many of my programs, but the program can't be installed on computers without VB installed (it can be installed, but the commands containing CreateObject("Scripting.FileSystemObject") doesn't work. I use the SetupWizard, but it doesn't include all the necessary dll's. Can someone tell me which dll's I need to add to my setup program so CreateObject("Scripting.FileSystemObject") work properly on computers without VB installed??

(Visual Basic 6)


/ChristianJ
ChristianJAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

GordonpCommented:
You need scrrun.dll.
The reason setup wizard does not include it automatically is because you using late binding.

Use Early Binding.

ie.

add Microsoft Scripting Runtime to your project references then

Dim oFileSystem as Scripting.FileSystemObject

Set oFileSystem = new Scripting.FileSystemObject


instead of

CreateObject(...)

GordonP
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
GordonpCommented:
There are also other advantages to Early Binding.


Syntax Errors are reported at Compile Time.

You get autocomplete etc..

Its Quicker, references to the dll are set at compile time rather than looking it up for each call.

Gordon
0
ChristianJAuthor Commented:
Excellent!! Exactly what I needed THANKS!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.