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

  • Thread starter Thread starter tbrundel
  • Start date Start date
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!
 
This will let you copy a file even if in use

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

Jim
 
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
.
 
Back
Top