469,613 Members | 1,274 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,613 developers. It's quick & easy.

FileSystemObject

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
1 16507
"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.

Similar topics

reply views Thread by Marcelo Rizzo | last post: by
5 posts views Thread by John Dewbert | last post: by
2 posts views Thread by Jason | last post: by
2 posts views Thread by Sean S - Perth, WA | last post: by
2 posts views Thread by Luis Esteban Valencia | last post: by
reply views Thread by devrayhaan | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.