File already open error

yinkajewole

Active Member
Joined
Nov 23, 2018
Messages
267
I want to move a file to another folder. Using this code, i got error "File already open"
Code:
 Name "c:\sour\file.txt" As "c:\dest\file.txt
Is there a workaround to move the file even when it is opened ?
 

Some videos you may like

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

NdNoviceHlp

Well-known Member
Joined
Nov 9, 2002
Messages
2,485
Sorry but U can't move an open file. U can use Copyfile to copy an open file to a new location. U can then close and Kill the old file. Why not just close the file before moving it? If the file may be either open or closed ( ie. unknown) then just add some error code to address both outcomes. HTH. Dave
 

Subscribe on YouTube

Watch MrExcel Video

Forum statistics

Threads
1,105,855
Messages
5,507,725
Members
408,647
Latest member
Nicho la zido

This Week's Hot Topics

Top