Solved

FileSystemObject

Posted on 2001-08-04
6
136 Views
Last Modified: 2010-05-02
I'm new to VB.  I've been writing VBScripting for a few however.  My question is what component do I add to my project to be able to use the FileSystemObject?
0
Comment
Question by:raizon
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 6

Accepted Solution

by:
JonFish85 earned 75 total points
ID: 6352713
Project -> References -> Microsoft Scripting Runtime


hope this helps!
0
 
LVL 6

Expert Comment

by:JonFish85
ID: 6352714
Then use something like this:

Dim fs As New FileSystemObject

'code here

set fs = nothing
0
 
LVL 6

Expert Comment

by:JonFish85
ID: 6352717
alternativly you can go:

Dim fs As Object

Set fs = CreateObject("Scripting.FileSystemObject")
'Stuff
Set fs = Nothing

but this is using "late binding" which is slower... Microsoft suggests using early binding, as in example above...
0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
LVL 5

Author Comment

by:raizon
ID: 6352720
Great.  Thats exactly what I needed.  I had the early binding set.  Which I'm glad that you posted that cause it confirmed that I was doing it correctly.

Thanks again
0
 
LVL 6

Expert Comment

by:JonFish85
ID: 6352724
glad to be of service!
0
 
LVL 5

Author Comment

by:raizon
ID: 6352726
Good luck on your MCSD.  

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Over the years I have built up my own little library of code snippets that I refer to when programming or writing a script.  Many of these have come from the web or adaptations from snippets I find on the Web.  Periodically I add to them when I come…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question