By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,434 Members | 2,963 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,434 IT Pros & Developers. It's quick & easy.

FileSystemObject

P: n/a
Hello

I am using the FileSystemObject to copy files on a computer

Dim MyObject as Object

Set MyObject = CreateObject("Scripting.FileSystemObject")

MyObject .CopyFile "C:\My Documents\Test.txt", "C:\New Folder\Test.txt"



It seems to work OK; the file is being copied but when I write the

code it doesn't behave as if there is any References involved.

Ex: when I write MyObject . usually there is a dropdown window with
available

options that appears; this is not happening.

Also when I write copyfile it should automatically Ucase the c and f
(CopyFile) and

it doesn't do this either.

Is this normal for FileSystemObject?

Is there a better way to delete and copy files and folders?

Does anyone know what Reference FileSystemObject uses?

Last: I read at the following link :
http://support.microsoft.com/kb/q197953/

that bloating will occur when Data Access Objects (DAO) is used to create
objects

in a database; is it the same with the code I am using?

Dim MyObject as Object

Set MyObject = CreateObject("Scripting.FileSystemObject")

Thanks

G Gerard
Nov 4 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"G Gerard" <gg*****@nbnet.nb.cawrote in message
<Jm*******************@ursa-nb00s0.nbnet.nb.ca>:
Hello

I am using the FileSystemObject to copy files on a computer

Dim MyObject as Object

Set MyObject = CreateObject("Scripting.FileSystemObject")

MyObject .CopyFile "C:\My Documents\Test.txt", "C:\New
Folder\Test.txt"



It seems to work OK; the file is being copied but when I write the

code it doesn't behave as if there is any References involved.

Ex: when I write MyObject . usually there is a dropdown window with
available

options that appears; this is not happening.

Also when I write copyfile it should automatically Ucase the c and f
(CopyFile) and

it doesn't do this either.

Is this normal for FileSystemObject?

Is there a better way to delete and copy files and folders?

Does anyone know what Reference FileSystemObject uses?

Last: I read at the following link :
http://support.microsoft.com/kb/q197953/

that bloating will occur when Data Access Objects (DAO) is used to
create objects

in a database; is it the same with the code I am using?

Dim MyObject as Object

Set MyObject = CreateObject("Scripting.FileSystemObject")

Thanks

G Gerard
You are using late binding, so no references are involved.

You can switch to early binding by referencing Microsoft Scripting
Runtime, then declare and instantiate like this

Dim MyObject as Scripting.FileSystemObject
Set MyObject = New Scripting.FileSystemObject

In these NGs you will often be recommended to use FileCopy in stead,
as it doesn't need any references (member of VBA.FileSystem). Check
it out in the help files.

--
Roy-Vidar
Nov 4 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.