Importing data from a file that is already opened by another application

T

tbrundel

I am importing data from textfiles on a server. Because
these textfiles have an extention which is unknown by
Access )no extention at all) i first copy these files to
another directory using the VBA.FileSystem.FileCopy
statement. With this statement I can change the name as
well to .txt

Everything works fine untill I try to import a file which
is used by another application. I can't quit this
application nor close the file so this is no option. But
I still have to import the file. If I use the windows
explorer I can easilly copy the file. Though when I try
my code i get an error 70 'permission denied' message.

Is there a way around this error? Can I copy files on
another way?

Thanks already!
 
J

Jim/Chris

This will let you copy a file even if in use

fso.copyfile "input file name", "output file name"

Jim
 
T

Timo

Which reference do I have to set?

Thanx,

Timo
-----Original Message-----
This will let you copy a file even if in use

fso.copyfile "input file name", "output file name"

Jim
.
 
B

Ben

Set a reference to the MS Scripting Runtime library, that should do the
trick.

HTH,
Ben
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top